Question: How can I prevent a .swf from loading twice in Flash? I am using onClipEvent (mouseUp) with a movie clip. When the user clicks the movie clip, it brings up an swf. The problem is, that this swf is there from the start, and it works fine if the user decides to click on another button first, before the banner... but if the user goes straight to the banner, it loads the swf a second time and it sits on top of the old one. How can I prevent it from reloading if it's already loaded? It starts out with the movie clip on the stage, then if a button or banner is clicked, it's removed. The problem is that when it is reloaded, it is from an outside swf.. so there's two seperate situations- movie clip starting on stage, movie clip loading from external swf.

Answer: Try giving the clip an id.  In the onClipEvent check to see if the contents of the ID exist, if they do, then don't load, but if it doesn't then don't load.... basically, use JavaScript and the Document Object Model to determine state of the object, and only load if the object doesn't yet exist.\n\nI hope that helps and makes sense.  If it's not clear enough, let me know and I'll elaborate.
This question from the Yahoo Q&A forum is categorized in the topic: Science & Mathematics