need script on outside controller buttons for pan, zoom. .

Specific Q&A about the new Flash export
Locked
User avatar
jaymzeberly
Posts: 19
Joined: Wed Nov 01, 2006 9:16 pm
Location: lost angeles

i am looking for code to put on buttons, like a button to steer the pano right, left, down, up, auto pan

something like this is not working:
------
on(press) {
// either of these do not work
vr.pan+=1;
vr.pan=vr.pan+1;

// this works but jumps it to the position, would like it to jab it over . by one each hit of the button or hold...
vr.pano.setTilt(10);
}
-------

this the rest of my code on my main layer:
-----
// Create container movieclip 
var vr:MovieClip = _root.createEmptyMovieClip("vr", 1);
// prevent access to "real" root
vr._lockroot=true;


//test jaymz
var playerControl:Function;


// Create a Movieclip loader
var myLoader = new MovieClipLoader();
var myListener = new Object();

myListener.onLoadStart = function () {
// Set the dimentions and position of the pano
vr.window_width = 320;
vr.window_height = 240;
vr.window_x=100;
vr.window_y=10;
// change initial viewing parameters
vr.pan=160;
vr.tilt=10;
// change autorotation
vr.autorotate=5;
vr.autorotate_delay=20;
};

// add the Listener
myLoader.addListener(myListener);

// ... and finally load the pano!
myLoader.loadClip("vr1.swf",vr);
-------

which works to load the movie, i want to set all the pano size, etc in the program but just make a player head that does not touch the actual movie, so it is like 50 pixels below on background. I have the one script working, just need to set the other for right , left , up, down, and autorate buttons.


since this works below i was trying to put in setZoom(1) but did not work, i do not need this set pan to a point, i want to pan by 1 :)
----
on(press) {
vr.pano.setPan(40);
}
---

if anyone have some hints let me know :)
User avatar
thomas
Chief Gnome
Posts: 2613
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

The value for Zoom is called Fov (Field of View) so if you change it to setFov it will work, but you can do the following:

Code: Select all

on(press) {
  vr.pano.changePan(1.0);
} 
on(press) {
  vr.pano.changeTilt(-1.0);
}
on(press) {
  vr.pano.changeFov(1.0);
}
I guess you get the idea ;)
MfG, Thomas
Locked