Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Detecting swf unload

Recommended Posts



I'm trying to figure out the proper way to detect the unloading of a swf loaded with SWFLoader.


My app is an AIR/iOS app that behaves differently on the device vs testing locally in Flash Builder.


When viewing the console in debug I see this in Flash Builder:


1) [sWF] assets/swfs/common.Page1.swf - 808,976 bytes after decompression

2) [unload SWF] assets/swfs/common.Page1.swf

3) [sWF] assets/swfs/common.Page2.swf - 969,002 bytes after decompression


However, looking at the debug console when testing on an iPad 1, I don't always see 2). It only appears after going to Page3. So sometimes a swf seems stuck in memory.


The ViewController function for adding pages is basically:

1) destroy, remove and nullify a "_currentPage" page it if already exists

2) garbage collect (System.gc() twice)

3) check to see if LoaderEvent.UNLOAD event has fired. if not, call same function again after slight delay


My question is if there is some other event that should be listened for to detect when the swf is truly unloaded? i.e. whatever actually happens in the Flash Player that displays this in the console: [unload SWF] assets/swfs/common.PageNameHere.swf


Hopefully this issue makes sense.


Thanks in advance for any help.



Link to comment
Share on other sites

Hm, I'm not exactly sure what to recommend - it sounds like an Adobe Air issue (maybe?). I'm pretty sure this isn't directly related to LoaderMax. I wish I had an easy answer for you.  :|

Link to comment
Share on other sites

Thanks for the response - makes sense. Was hoping somebody might have run across similar issue and found a fix.


I'm hoping there is something that can be detected after flash.events.Event.UNLOAD is dispatched which indicates the content is definitely unloaded.


Will investigate with Adobe.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.