views:

43

answers:

1

Hi,

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.

A: 

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

gustyaquino