Jareish
11-05-2008, 09:38 PM
Hi, I have this movieclip container in embedpano, I have to hide, while the panorama is loading, and appear when it's done loading. And I can't figure it out, where to put it.
function loadComplete(e:Event) {
panorama = loader.content as MovieClip;
panorama.setArea(150,20,570,380);
container.visible = true;
panorama.loadPanorama("panoName="+thePanoToLoad+"&xml_file=base/_setup.xml");
[...]
}
I've tried hiding it, everytime a new pano loads, but I cant seem to track when its done. loadComplete, only seems to be fired once at initialisation.
function loadPanoFunction(event:Event) {
[...]
}
if (thePL == -1) {
if (panorama.externals.hotspots!=null) {
if (panorama.externals.hotspots.panoName == thePanoToLoad) {
} else {
panorama.externals.hotspots.loadPano(["pano.swf?panoName="+thePanoToLoad]);
addEventListener(Event.ENTER_FRAME, panoLoadWatcher);
container.visible = false;
}
} else {
panorama.pano.remove();
panorama.loadPanorama("pano.swf?panoName="+thePanoToLoad);
addEventListener(Event.ENTER_FRAME, panoLoadWatcher);
container.visible = false;
}
}
}
I even tried to add it in the panoloadwatcher, by checking if the procentloaded is equal to 100 (show container, else hide).
function panoLoadWatcher(e:Event=null) {
if (panorama.externals.hotspots!=null) {
if (full_btn.visible == true) {
full_btn.visible = false;
}
//Basicly always hide the container @ every tick of the timer, unless procentloaded is a 100.
if (container.visible == true) {
container.visible = false
}
//
theBL = panorama.pano.bytesLoaded;
theBT = panorama.pano.bytesTotal;
thePL = panorama.pano.percentLoaded;
trace("PANO bytesLoaded?: "+theBL);
trace("PANO bytesTotal?: "+theBT);
trace("PANO percentLoaded?: "+thePL);
if (thePL >= 100) {
theBL = -1;
theBT = -1;
thePL = -1;
full_btn.visible = true;
container.visible = true;
removeEventListener(Event.ENTER_FRAME, panoLoadWatcher);
}
}
}
But the last seems to always hide the container, even if thePL reaches 100. The container is ontop the panorama
function loadComplete(e:Event) {
panorama = loader.content as MovieClip;
panorama.setArea(150,20,570,380);
container.visible = true;
panorama.loadPanorama("panoName="+thePanoToLoad+"&xml_file=base/_setup.xml");
[...]
}
I've tried hiding it, everytime a new pano loads, but I cant seem to track when its done. loadComplete, only seems to be fired once at initialisation.
function loadPanoFunction(event:Event) {
[...]
}
if (thePL == -1) {
if (panorama.externals.hotspots!=null) {
if (panorama.externals.hotspots.panoName == thePanoToLoad) {
} else {
panorama.externals.hotspots.loadPano(["pano.swf?panoName="+thePanoToLoad]);
addEventListener(Event.ENTER_FRAME, panoLoadWatcher);
container.visible = false;
}
} else {
panorama.pano.remove();
panorama.loadPanorama("pano.swf?panoName="+thePanoToLoad);
addEventListener(Event.ENTER_FRAME, panoLoadWatcher);
container.visible = false;
}
}
}
I even tried to add it in the panoloadwatcher, by checking if the procentloaded is equal to 100 (show container, else hide).
function panoLoadWatcher(e:Event=null) {
if (panorama.externals.hotspots!=null) {
if (full_btn.visible == true) {
full_btn.visible = false;
}
//Basicly always hide the container @ every tick of the timer, unless procentloaded is a 100.
if (container.visible == true) {
container.visible = false
}
//
theBL = panorama.pano.bytesLoaded;
theBT = panorama.pano.bytesTotal;
thePL = panorama.pano.percentLoaded;
trace("PANO bytesLoaded?: "+theBL);
trace("PANO bytesTotal?: "+theBT);
trace("PANO percentLoaded?: "+thePL);
if (thePL >= 100) {
theBL = -1;
theBT = -1;
thePL = -1;
full_btn.visible = true;
container.visible = true;
removeEventListener(Event.ENTER_FRAME, panoLoadWatcher);
}
}
}
But the last seems to always hide the container, even if thePL reaches 100. The container is ontop the panorama