开发者

Unable to reload the swf again in my flex applicaion (AIR)

In my flex application I am showing a titleWindow as popup which has a swfLoader and it loads one swf file. My application and the loaded swf file communicate with the help of LocalConnection. And here is the flow.

  1. When the popup opens, I create a connection.

    connection:LocalConnection = new LocalConnection(); connection.client = this; connection.connect('ApplicationConnection');

  2. Then I load swf. (This swf has a timer in it. And on every tick of it, I print a trace).

    swfLoader.source = 'path/to/file';

    Then when I try to close the pop up, 开发者_如何学编程its close event handler does the following

  3. Unload and stop the swf.

    swfLoader.unloadAndStop(true);

  4. Disconnect the connection.

    connection.close();

After all this, in my trace I can still see that the swf timer is going on (as the trace in it keeps printing). And if I try to open the pop up again, it throws the error at the first step while connecting. It says that it could not connect as the object is already connected. Is this the problem with swf unload or with connection closing or both? Kindly help me in resolving this issue.


Sugestion: Try adding the 'unload' event listener to you SWFLoader as you can see if it really unloads.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜