question about container.fla from the park virtual tour

Specific Q&A about the new Flash export
Locked
gerardjuarez
Posts: 7
Joined: Wed Sep 26, 2007 2:57 pm
Location: Dallas, TX
Contact:

Does anybody know how to modify the actionscript to check the stage width and height and call to vr.pano.setWindowSize(Stage.width,Stage.heigth) with the desired pano size?

I'm trying to get this to go fullscreen...

http://panomotionstudio.com/flash/Touri ... arden.html

but it's stuck at the dimensions of the source swf file (1024x512) and for the life of me, I can't figure it out! Not only that, but my hotspots fall outside the range of the swf file for some reason. Thanks!
User avatar
thomas
Chief Gnome
Posts: 2613
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

You should get the stage width and height with:

Code: Select all

var w:Number=Stage.width;
var h:Number=Stage.height;
See also: http://www.adobe.com/livedocs/flash/8/m ... 02696.html

btw: Very nice demo!!!
MfG, Thomas
gerardjuarez
Posts: 7
Joined: Wed Sep 26, 2007 2:57 pm
Location: Dallas, TX
Contact:

Thomas, thanks for the compliments. Well i tried your suggestion by defining 2 variables, the setting vr.pano.setWindowSize(w,h) as such. This still doesn't work properly for some reason. When the window initilally loads, the pano is fullscreen, then I click another hotspot and the pano scales from the center of the page out so it clips half of the pano? Am I doing something wrong with the code?

var radar_offset:Number=0;
var currentid:Number=0;
var topid:Number=1;
var hotspots:Array=new Array;
var w:Number=Stage.width;
var h:Number=Stage.height;

// Create container movieclip
var vr:MovieClip = _root.createEmptyMovieClip("vr", 1);
// prevent access to "real" root
vr._lockroot=true;

function clearHotspots() {
var mc:MovieClip;
var i:Number;
for (i=0;i<hotspots.length;i++) {
mc=hotspots;
mc.removeMovieClip();
}
hotspots=new Array();
}

function loadPanorama(id:Number) {
// Create a Movieclip loader
var myLoader = new MovieClipLoader();
var myListener = new Object();

// remove old Hotspots
clearHotspots();

myListener.onLoadStart = function () {
var filename:String;
// Set the dimentions and position of the pano
vr.pano.setWindowSize(w,h);
vr.window_width=0;
vr.window_height=0;
vr.window_x=0;
vr.window_y=0;
// change autorotation
vr.autorotate=0;
vr.autorotate_delay=20;
Locked