Jul
08

Posty runs on Linux

I took some time to test Posty on Linux. Inspite the fact that Adobe Air for Linux is still alpha version, I am surprised that Posty runs fine on major Linux distributions. The only issue, first identified by Daria, is that Posty is memoryless, that is you set it to remember login data, but when you run the application again, you have to re-enter data again. I am in contact with Adobe engineers to discuss the issue.

The first distro I tried is PcLinuxOs. Very easy to install on Paralles. It also associated the .air file extension to the Air installer application. AS you can see in the video, you click on the .air file and Posty installs.



Posty on PCLinuxOs from funkyboy on Vimeo.



Then I tried OpenSuse. Like PcLinuxOs was easy to install and set up. i had to run Adobe Air installer from the console. It is located in the /opt folder:


/opt/Adobe AIR/Versions/1.0



Posty on OpenSuse from funkyboy on Vimeo.



Another mainstream distro I tested is Mandriva. Apart from a warning in the console all went fine.



Posty on Mandriva from funkyboy on Vimeo.



I already had an installation of Ubuntu. Setting up Posty was easy.


Posty on Ubuntu 8.04 from funkyboy on Vimeo.


Finally I tried Knoppix, which was the quickest to boot.



Posty on Knoppix from funkyboy on Vimeo.



I also tried CentOs, but it thrown an “Error loading the runtime” and Slax 6.0.7, which asked me to be root, whereas I already was logged as root.


Credits:



Thanks to Daria, who first tried installing Posty on Ubuntu 7.10 and inspired me to test Posty on other distributions.


UPDATE: An Adobe Air engineer told me that Encrypted Local Store is not yet implemented on the Linux version of Adobe Air.

Jul
01

Deleting Encrypted data in Adobe Air

Adobe Air apis allow storing encrypted data on your hard drive. During a conversation with an Adobe engineer I discovered that data are stored in this directory:

      Adobe/AIR/ELS/



For example on my mac data are stored in:

      /Users/MYUSERNAME/Library/Application Support/Adobe/AIR/ELS



Of course you can delete encrypted data via code by using:

      EncryptedLocalStore.reset();



Beware, this deletes ALL stored data!

More information here.

ps: I plan to implement a button in Posty to delete encrypted data, e.g. in case you install Posty on a computer which is not of yours and you wanna clean up hard disk from sensible data.

May
30

Dynamic function calling in Flex

Sometimes I have the need to associate two different actions to the same button. It is not always a good solution. Indeed, good user interfaces should have a clear layout and buttons should always do the same thing. Sometimes, but very rarely, you can disregard such a rule and associate different actions to the same button. It is the case of play/pause. If you check your Itunes you will notice that when you click play the button changes icon to pause and viceversa. Same for Windows Media Player and many other players. This is allowed because actions are distinct and mutually exclusive.
I was in front of a similar situation when I added the possiblity to visualize comments in Posty. The feature is very similar in Pownce, which allows replies to posts, and Friendfeed which has comments attached to entries. What I wanted to obtain is a button which is:

  • visible when there are comments/replies
  • dynamic, in the sense it switches functionality (and label) according to the state of comments/replied (shown or hidden)

To give you the flavor of my solution here I propose a demo with a button that shows/hides a logo.


Demo (right click to view source).


The solution exploits Flex capability to represent functions as objects. If you check out the code you’ll see a variable declared like this:

	private var _functionToBeCalled:Function = showLogo;;

The application initializes the variable with the showLogo function assigned by default. When executed, this function shows the logo, sets hideLogo
as the function to be called next time and changes the label to “Hide logo”.

	private function showLogo():void {
		logo.visible = true;
		this.linkButton.label = “Hide logo”;
		this._functionToBeCalled = hideLogo;
	}

The hideLogo function does the exact “opposite”: hides the logo, sets the function to be called back to showLogo and changes the label.

Enjoy the trick!

Apr
03

Parsing xml in Flex - The case of tag names with a dash

I am a fan of json.
I use it extensively but sometimes I am forced to use xml. A pretty well know way to parse xml in Flex and Adobe air is the following:

  var xml:XML = new XML(“<data><tag>content</tag></data>”);
  private function parse():void {
	 for each (var t:XML in xml.children()) {
		trace(“tag name: “+t.name()+” tag content “+t.text());
	}
  }

Sometimes you are not the one who establishes tag names, e.g. xml comes from a webservice and you have to use it as it is. In developing Posty I had to parse xml coming from a microblogging service, Tumblr. An sample xml returned by tumblr is the following.

<post id=”30451729″ …>
	  <regular-body>Text of my post…</regular-body>
</post>

Notice there is a dash in some tag name. To render data you parse the xml and extract relevant data. Adopting the same approach explained above, to retrieve the content of a tag you’d write:

  for each (var x:XML in xml.posts.post) {
    trace(“my regular body is “+ x.regular-body);
  }

You will not be able to run this code. The compiler will say: access of undefined property body. What! I can’t parse xml with dashed tag names? No you can’t. More evidence from here[link]. The solution is to exploit a different syntax, which allows to access data in a dashed-name tag:

  for each (var x:XML in xml.posts.post) {
    trace(“my regular body is “+ x.child(“regular-body”));
  }

The compiler will be happy and your xml will be parsed successfully.

Mar
20

Adobe Air already on iphone (sort of)

I started developing in Flash, doing websites. I then moved to Flash mobile (before the introduction of flite) and developed a mobile guide for a research project. When Flex was presented I didn’t dive into it, because I was busy with other projects and languages. When Adobe Air (introduced as Apollo) was released I started experimenting again. When I heard of the iphone I thought: “This is the platform of the future!”. But I felt disappointed when Steve confessed he didn’t like Flash on the iphone. Now I am simply thinking:

  • isn’t iphone running Safari? Yes
  • isn’t Safari based on webkit? Yes
  • aren’t Adobe Air application partly running on webkit? Yes, if developed in javascript/html.

So? I think it is not far the moment that ad Adobe Air application will run on the iPhone.

top