More Flash control

Q&A about the latest versions
Post Reply
Posts: 2
Joined: Thu Oct 04, 2007 10:34 pm

Thu Oct 04, 2007 10:37 pm

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?
User avatar
Chief Gnome
Posts: 2564
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria

Fri Oct 05, 2007 1:27 pm

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:

Code: Select all

 var vr:MovieClip = _root.createEmptyMovieClip("vr", 1);
 var myLoader = new MovieClipLoader();
 var myListener = new Object();
 myListener.onLoadStart = function () {
 // Set the dimensions and position of the pano
 myLoader.loadClip("mypanorama.swf", vr);
or you can move the panorama after the loading with

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
Posts: 2
Joined: Thu Oct 04, 2007 10:34 pm

Fri Oct 05, 2007 3:23 pm

That worked! Why the methods I tried before didn't work I've no idea. This works and I can adapt it to the rest of the project. Thanks!
Post Reply