GIFPlayer Not working in Flex 4.6 AIR

混江龙づ霸主 提交于 2019-12-08 12:53:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!