Having a lot of trouble centering a 200x200 .swf within a 400x400 .fla file. It renders just fine using the script from the api page, but it always snaps to upper left corner, no matter what settings I use for "setWindowPos"
Using CS5, AS3 script from API posted on the Garden Gnome wiki.
Code: Select all
function initObj(e:Event) {
// check if the panorama object is available and initialize it
if ((vr!=null) && (vr.obj!=null)) {
removeEventListener( Event.ENTER_FRAME , initObj);
vr.obj.setWindowSize(400,400); // resize the window
vr.obj.setWindowPos(200,200); // reposition
Code: Select all
// Set the dimensions and position of the pano
vr.window_width=500;
vr.window_height=380;
vr.window_x=100;
vr.window_y=10;
};
I *have* successfully made the SWF to center within Flash within AS2, however the motion of the object SWF is chunky, resets oddly at random times, and the movie will only orbit when the mouse cursor is within the movie (forcing the user to click-pan-click-pan to rotate the model - not an ideal situation).
With AS3, the mouse can exit the frame and still orbit the movie, which is very nice.
Does anyone have any ideas? Are there tricks using skins? I tried to make a 400x400 skin, but that didn't seem to make a difference when bringing the swf into Flash CS5.
Also I'm having problems doing this in CS3. I have also tried to put the object SWF within a folder in Flash, and tried to move that new folder around, using align tool, center tool for example.
Thanks for any help!!