PDA

View Full Version : Load method in AS3 - how to unload?


bob-byrne
10-01-2008, 11:44 PM
Hi all - I am working on a "Virtual Watertreatment Plant", and am loading my panoramas from within another Flash (as3) file using the load method as follows. Panoramas are loaded upon clicking a button in the parent Flash. I'm running into problems, I believe because panoramas are not being unloaded completely before a new panorama is loaded in it's place. Any help is greatly appreciated.

------------------------
var panorama:MovieClip;
var loader:Loader = new Loader();

function doFlocroom (event) {
loader.load(new URLRequest("flocroom/flocroom.swf"));
addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadComplete);
function loadComplete (e:Event) {
swapChildren(loader, border);
panorama = loader.content;
panorama.setArea(10,10,980,600);

panorama.loadPanorama("panoName=flocroom/flocroom&xml_file=flocroom/flocroom.xml"); //load images with custom xml file

etc.
------------------------

Nate
10-02-2008, 03:33 AM
I heard somewhere that you should load and unload through hotspots.swf not through flash itself.
http://flashpanos.com/tutorials/patrick/embedding-fpp-panoramas-another-flash-container
Example