So I am trying to make a new flash website for my portfolio (Using Flash Pro CS5.5 with Actionscript 3.0). Obviously to save on load times when someone clicks a portfolio category I want an external SWF to load in and once they leave that page to go back, I want it to go away. Seems simple, yet once my SWF loads, it will not disappear. Here is the link: http://www.nickgourlie.com/flashsite.html To find the problem area click "Portfolio" then "Graphic Design" then "Graphics." My SWF then loads correctly but once you click back to the portfolio or anywhere else, the SWF stays loaded in the background. How do I unload it??
Here is my code where "GraphicsScroller" is my external SWF:
var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("flashfiles/GraphicsScroller.swf");
myLoader.x = 125;
myLoader.y = 132;
Also if you have a better load/unload code that would be better in this situation let me know. I've been messing with different codes for a few days now and I am getting pretty frustrated.
Thanks for any help!
I don't see anything that would unload the loaded file. You should have a line like...
somewhere, such as in code for any buttons that could be clicked to changes sections.
In case you are using the timeline for the different sections, when you dynamically add content it has nothing holding it to the timeline unless you add it to something that was not dynamically created that lives in the timeline, such as an empty movieclip that you manually place on the stage. If the dynamically added content is not anchored to something then it will persist throughout the timeline.