Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 使用嵌入内容的图像控件未触发完成/进度事件_Apache Flex_Image_Mxml_Flex3 - Fatal编程技术网

Apache flex 使用嵌入内容的图像控件未触发完成/进度事件

Apache flex 使用嵌入内容的图像控件未触发完成/进度事件,apache-flex,image,mxml,flex3,Apache Flex,Image,Mxml,Flex3,我有以下MXML标记: <mx:Image id="image" width="100%" height="100%" source="@Embed('../assets/Test.swf')" complete="completeHandler(event)" progress="progressHandler(event)"/> 但是由于某些原因,我的completeHandler/pro

我有以下MXML标记:

<mx:Image id="image" width="100%" height="100%" 
              source="@Embed('../assets/Test.swf')" 
              complete="completeHandler(event)" 
              progress="progressHandler(event)"/>
但是由于某些原因,我的completeHandler/progressHandler函数没有被调用。我需要完整事件的原因是,我希望在加载图像后操作位图数据。在creationComplete中,位图数据仍然为空。为什么这些事件没有发生


编辑:资产在我的应用程序中正确显示-因此我知道资产位于正确的位置。嵌入保证在编译时仍然可以检查资产路径。

。最可能的情况是,swf路径不正确,或者没有被复制到调试生成/发布生成目录中的资产文件夹中。

如果使用嵌入式资产,则源对象上的宽度/高度属性立即可用:

var mySource:Object = new embeddedClass();
m_myWidth = mySource.width;
m_myHeight = mySource.height;
m_image = new Image();
m_image.source = mySource;

因此,您必须首先创建源的实例,然后在图像对象上设置源。

因此,您只需将Event.COMPLETE侦听器直接添加到loader.contentLoaderInfo而不是加载程序。我不敢相信这不是文档中的行为。

这似乎是这里的预期行为

从文件中:

不能保证调度进度事件。可以接收完整事件,而不发送任何进度事件。当加载的内容是本地文件时,可能会发生这种情况

因此,我认为这一部分可以解释为什么在您的示例中没有捕获任何进展事件

内容加载完成时发送。与完整事件不同,此事件针对所有源类型进行调度。 注意,对于通过Loader加载的内容,ready和complete事件都被调度。 对于其他源类型(如嵌入),只调度ready


它清楚地表明,在处理嵌入式源时,您应该侦听就绪事件,而不是完整事件

内容是否正确显示在您的应用程序中?