switching between different swf's

Using Pano2VR/Object2VR SWF files with your own Flash projects
Post Reply
theharry
Posts: 1
Joined: Wed Jun 16, 2010 10:28 am

I am confused! I have a flash file witch load a panorama swf and a object2vr swf. About the menu the user could switch between the pano and the object movie. I load the swf about the script from the tutorial page:

Code: Select all

var vr:MovieClip = _root.createEmptyMovieClip("vr", 1);
vr._lockroot=true;
// move the upper left corner
vr._x=100;
vr._y=200;
var myLoader = new MovieClipLoader();
var myListener = new Object();
myListener.onLoadStart = function () {
// Set the dimensions and position of the pano
  vr.window_width=500;
  vr.window_height=380;
  vr.window_x=100;
  vr.window_y=10;
};
myListener.onLoadInit = function () {
  // your initalisation of the pano, add Hotspots,...
  // You can also set the window size here but you need to use the API
  vr.pano.setWindowSize(500,380);
};
myLoader.addListener(myListener);
myLoader.loadClip("mypanorama.swf", vr);
I use this code in a function() which wll start load with a click on a button, one function for the pano, one for the object. In all cases i attached a menu bar in the forground from the lib:

Code: Select all

var border:MovieClip=_root.attachMovie("border_lib","border",20001,{_alpha:100});
The first swf starts perfect, but when I switch about the buttons, the other swf comes in the forground about my menu bar. I have try to cleanup, unload etc.... nothing helps. Could anybody help me here?!
Noisy
Posts: 35
Joined: Wed Apr 04, 2007 12:49 am
Location: Scotland

seems like the object movie is being loaded Into the next available depth. need to see the code that's actually used.

if that is the case, a quick fix after you have loaded it could be

objectMovieName.swapDepths(border);

but it would be better to get it in the right place first go.
Post Reply