More Flash control
I'm trying to import the SWF into another Flash document, but for whatever reason I have no control over where the VR Flash file appears on the stage. It always defaults to the top left corner, no matter what Actionscript I use to tell it otherwise. Is there anyway to turn off forcing the position of the VR to 0, 0 in the resulting SWF?
Yes, there are 2 ways to do this:
- If you want to set the position before the initialization you can send the position to the movie clip with:
or you can move the panorama after the loading with
- If you want to set the position before the initialization you can send the position to the movie clip with:
Code: Select all
var vr:MovieClip = _root.createEmptyMovieClip("vr", 1);
vr._lockroot=true;
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;
};
myLoader.addListener(myListener);
myLoader.loadClip("mypanorama.swf", vr);
Code: Select all
vr.pano.setWindowSize(<width>,<height>); // sets the current panorama window size
vr.pano.setWindowPos(<x>,<y>); // sets the panorama window position
MfG, Thomas