I have swf with some js callbacks registered using ExternalInterface. I hide and show swf several times, and I found out that ExternalInterface is not available when swf is hidden. I also noticed that the swfs constructor is called every time it shows again what I used to make sure I'm not trying to call the ExternalInterface function before it is available. This makes me wonder if there is any way to reliably tell the inside of swf when it is hidden? I know that as3 classes do not have destructors, but is there something similar that can be used to trigger the ExternalInterface event before swf becomes unavailable again? REMOVED_FROM_STAGE does not seem to help in detecting this, since it does not work at all.
I use several methods to hide and show btw. Sometimes angular ng-hide / ng-show is used, and sometimes swf is in the modal boot window.
In addition, I noticed that Flash Builder can somehow say when swf is unloaded. I can add a button that sets "display: none" to the built-in <object>, and I get a [Unload SWF] message in the console in Flash Builder. Is it just a debugging player function, or is there some secret event that Flash Builder knows about that I have not yet been able to find?
source
share