Jump to content


stop SWF code execution

Recommended Posts



I am using the loaderMax to preloader some SWF. My problem is that the code of each SWF starts to play as soon as the swf is loaded (even if the swf isn't on the frame).


My code to load is this one :

var URLs:Array = ["site.swf", "CA.swf", "candidatures.swf", "contact.swf", "dates.swf", "DD.swf", "documents d'organisation.swf", "engagements.swf", "environnement.swf", "metiers.swf", "proprete.swf", "securite.swf", "service de proximite.swf", "social.swf"];
var queue:LoaderMax = LoaderMax.parse(URLs,{maxConnection:1, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});



I have used a "parse" because it is more confortable, but I can change.


My second question is : When I unload a SWF from the frame ("removeChild" and "unload"), how can I stop the execution of it's code ?


Thank you for your help.



Link to comment
Share on other sites

As for your first question you should use some sort of init() function in your child swf that gets your code running. Call init() from the parent swf once the child is fully loaded.




For number 2 check out this article on unloading swfs: http://joshblog.net/2009/04/23/unloading-child-swfs-in-flash/


It has nothing to do with LoaderMax but the same concepts apply.


Hope that helps.

Link to comment
Share on other sites

Thank you for your answer carl,


I misspoke, I want that the code of my child loaded doesn't start. The problem is that automatically, it starts.


Do you have an idea ?

Link to comment
Share on other sites

I believe my previous answer still applies. code your child swf so that no code/functions will execute until a particular function is called. I used init() as a common name. When you want the child swf's code to run, call init() from the parent.

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.