Archive

Archive for June 17, 2011

Bind Array in AS 3.0 – Can we do it?

June 17, 2011 Leave a comment

No we can’t.

We all have loved Arraycollection so much that we almost forget about Array.

All those push() and pop() methods got obsolete against addItem() and removeItem().

Even I also got stumbled upon when one of my friend ask me about this.

Offcourse, ArrayCollection is much more developer friendly. So better to stick to that. :)

Categories: Action Script 3.0, Flex

GIF animation in AIR

June 17, 2011 Leave a comment

To display the GIF animation in an air application here is a way to embed in an HTML component.

First of all create a HTML component object on your desired event. I have placed itunder creationComplete();

public function loadImage():void{
     var cuteDog:HTML = startAnimation("assets/images/dog.gif");
     cuteDog.height = 80;
     cuteDog.width = 80;
     parentContainer.addElement(cuteDog);
}

“startAnimation” function will trigger the do the trick here.

public function startAnimation(url:String):HTML
{
     var gifLoader:HTML = new HTML();
     gifLoader.location=url;
     gifLoader.reload();
     return gifLoader;
}

Just set the desired height and width for the HTML component and its parent component. Finally call the addElement() to add in application.

Categories: Air only Tags: , , ,
Follow

Get every new post delivered to your Inbox.