开发者

Unhandled IOErrorEvent in SWF file called by Flex4

开发者 https://www.devze.com 2023-02-08 03:53 出处:网络
HI, I am getting an issue, that might be simple to solve it, but I`m stuck in it, so.... here is my code:

HI, I am getting an issue, that might be simple to solve it, but I`m stuck in it, so....

here is my code:

<mx:SWFLoader source="@Embed('assets/games/memory.swf')" includeIn="memory" trustContent="true"/>

I am loading a swf file, which I did, but the think is, in this swf file I am doing URL request to get an image file, when I open the swf it works fine, but when I loa开发者_开发问答ded using the code above, I`m getting a error:

Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

everything loads fine, just the image which I am getting externally it`s not loading!

Someone know how to solve that?

thanks!

EDIT:

if I run as debug mode, I got this message in console:

[SWF] Machine.swf/[[DYNAMIC]]/1 - 277,632 bytes after decompression
SharedObjectExample() loaded
SharedObject loaded...

loaded value: undefined

EDIT2: Interesting think, I got working using a BulkLoader, and the interesting think is, when I use the BulkLoader and running in debug mode, I got:

[SWF] assets/games/memory.swf - 277,632 bytes after decompression
SharedObjectExample() loaded
SharedObject loaded...

loaded value: undefined

It might be PATH issue, the question is: When I load using SWFLoader, does it load in a different context path?


I found out the solution, the trick is, if I load the swf files as 'Embed' all the relative path(inside the swf) will be my main app(mais swf), so I was getting this trace:

[SWF] Machine.swf/[[DYNAMIC]]/1 - 277,632 bytes after decompression

If I want to use realtive paths inside my 'child' swf, I cannot load as 'Embed'!

so, to solve that I just change my code to:

<mx:SWFLoader id="loader" source="assets/games/memory.swf" includeIn="memory"/>

EDIT:

I posted a thread in my blog explain it as well: http://arthurnn.com/blog/2011/02/03/trick-using-swfloader-to-load-a-swf-file/

0

精彩评论

暂无评论...
验证码 换一张
取 消