问题
I am working with Flex 4.6 AIR Application. I am using GIFPlayer for play animated gif file. I have a TileList and I use a itemRenderer for displaying this image. The problem is it hangs the AIR application when it loads. I am using the library of GIFPlayer you can download it from HERE
The code of itemRenderer is below.
override public function set data(value:Object):void
{
if(value != null)
{
super.data = value;
var gif:GIFPlayer = new GIFPlayer();
gif.load(new URLRequest(data.image));
var uic:UIComponent = new UIComponent();
uic.addChild(gif);
this.addElement(uic);
}
}
回答1:
Your set data
should better look like:
override public function set data(value:Object):void
{
super.data = value;
if(value != null)
{
gif.load(new URLRequest(data.image));
}
}
and the other methods called in the constructor or createChildren
method
来源:https://stackoverflow.com/questions/18825914/gifplayer-not-working-in-flex-4-6-air