GIFPlayer不工作的Flex 4.6 AIR [英] GIFPlayer Not working in Flex 4.6 AIR

查看:189
本文介绍了GIFPlayer不工作的Flex 4.6 AIR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Flex 4.6 AIR应用程序。我使用GIFPlayer进行播放动画GIF文件。我有一个TileList和我使用的itemRenderer显示此图像。问题是,它挂在AIR应用程序加载时。我使用GIFPlayer的图书馆,你可以从的这里

的itemRenderer的code是如下。

 重写公共职能组数据(值:对象):无效
{
    如果(值!= NULL)
    {
        super.data =价值;
        VAR GIF:GIFPlayer =新GIFPlayer();
        gif.load(新的URLRequest(data.image));
        VAR UIC:UIComponent =新UIComponent();
        uic.addChild(GIF);
        this.addElement(UIC);
    }
}
 

解决方案

组数据应更好地样子:

 重写公共职能组数据(值:对象):无效
{
    super.data =价值;

    如果(值!= NULL)
    {
        gif.load(新的URLRequest(data.image));
    }
}
 

和调用构造函数中的其他方法或 createChildren 方法

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);                       
    }   
}

解决方案

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

这篇关于GIFPlayer不工作的Flex 4.6 AIR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆