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.
When the popup opens, I create a connection.
connection:LocalConnection = new LocalConnection(); connection.client = this; connection.connect('ApplicationConnection');
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
Unload and stop the swf.
swfLoader.unloadAndStop(true);
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.
精彩评论