views:

177

answers:

1

Hi,

I have a html popup containing one flash file. Onclose of the popup I need to write some values into the socket. How can I handle the onclose event from flash ?

Thanks Binoy

+2  A: 

Try handling the onclose event from javascript and call flash from javascript using ExternalInterface.addCallback.

Careful when setting up your html document for ExternalInterface though.

George Profenza
The "careful" bit, I guess, refers to the fact that you need to allow actionscript-javascript communication when embedding the SWF file, by setting the allowScriptAccess embed parameter to true. :)
richardolsson
thanks a lot.. hope it will work in all browsers
binoy
yes, that and making sure embed tag's id attribute and object tag's name attribute are the same. Some browsers access the swf via the embed tag, others use the object tag, so careful with that too. If it doesn't work in firefox and IE for example, look for that pitfall
George Profenza