haha, well, this exact error is not pano2vr realted, it's poorly written sunlight graphix
So just ignore it...
Thx, this code seem to work that way!
Exactly, that's why they used enter frame in first place it seem...
haha, well, about alpha i know )
It's just stupid mistake that i've done when simplifing code
And now comes my most hardcore question...
Inside 1st frame of my test file, please find a function called cleanUp!
// cleanup of currently loaded elemnt
function cleanUp(e:Event):void {
// CLEAN VIRTUAL REALITY
for (var v:int = 1; v <= 2; v++) {
// create temp vars for vr and loaderVR instances
var vr:MovieClip = this["vr" + v] as MovieClip;
var loaderVR:Loader = this["loaderVR" + v] as Loader;
// check if vr exist on stage
if (vr != null && vr.pano != null && vr.stage) {
// remove vr instance
vr.pano.bmpTile[0].dispose();
vr.pano.bmpTile[0] = null;
vr.pano.bmpTile[1].dispose();
vr.pano.bmpTile[1] = null;
vr.pano.bmpTile[2].dispose();
vr.pano.bmpTile[2] = null;
vr.pano.bmpTile[3].dispose();
vr.pano.bmpTile[3] = null;
vr.pano.bmpTile[4].dispose();
vr.pano.bmpTile[4] = null;
vr.pano.bmpTile[5].dispose();
vr.pano.bmpTile[5] = null;
loaderVR.mouseChildren = false;
vr.pano.cleanup();
loaderVR.unloadAndStop();
removeChild(loaderVR);
vr.pano = null;
trace ("vr" + v + " cleanup done");
// kill all sound
SoundMixer.stopAll();
}
}
As you can see it is extremely hard to clean virtual reality, coz it have at least 6 heavy bitmaps (faces of cube), which need to be disposed and nullified...and only then i should unloadAndStop, and finally remove .swf, afterwords killing it's own sound %)
Mess, ain't it?
My question is of course - how should i unload such a crazy stuff with loaderMax, if i'll use code you've provided above to add it on stage?
And the most interesting part i would like to know about loaderMax, is it's benefits of unloading content, compared to native flashes loader...I want to always clean all the loaded mess when it's not needed, memory is something i want to keep low with every project, but it's so hard sometimes...