Page 1 of 3
Pano2VR - Flash 9 API
Posted: Fri Oct 19, 2007 10:34 pm
by thomas
The basic Actionscript 3.0 code to load a panorama into you own Flash 9 project looks like this:
Code: Select all
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var loader:Loader;
loader = new Loader();
var url:String = "park.swf";
var urlReq:URLRequest = new URLRequest(url);
var vr:MovieClip;
// This is done after the swf is loaded.
function finished_loading (e:Event) {
}
function initHandler(event:Event):void {
trace("initHandler: " + event);
vr = MovieClip(loader.content); // cast 'DisplayObject' to 'MovieClip'
vr.pano.setWindowSize(200,100);
}
// Tell the loader to call 'finished_loading' after the swf is loaded.
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, finished_loading);
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.load(urlReq);
addChild(loader); // add your swf directly to the stage
I have set up a wiki page for the API where you can find the other calls at
http://gardengnomesoftware.com/wiki/Pano2VR_-_Flash_API
AS3
Posted: Sat Nov 10, 2007 4:33 pm
by ricardo
Hi Thomas,
I created a new container in AS3 to handle Flash 9 panos.
Everything is working fine, but pano api calls.
How can I call zoom in AS3?
Thanks in advance,
Ricardo
Posted: Wed Nov 14, 2007 9:42 pm
by thomas
Zooming = changing the FoV so for example <panoclip>.pano.changeFov(-1.0); will zoom in.
Re: Pano2VR - Flash 9 API
Posted: Fri Jan 11, 2008 5:04 pm
by refocus
Hello,
i tryed to load my Flash 9 Panos (with embeded navi for fullscreen, zoom and stuff)
into a another Flashfile with that code.
The initial - Loading works. But i got two problems.
How can i change the source of the Pano via a Actionsscriptfunction (AS3 code)
and the second problem when loading the Flash 9 Pano into another swf with AS3 Code i like to assign it to a movie clip
instead of loading it to the whole stage....
it schould work similiar to AS2 Code / Examples on your site..
How can i'll do that?
Thx in Advance for your Help.
Andy.
Re: Pano2VR - Flash 9 API
Posted: Sat Jan 19, 2008 2:15 am
by RealVision360
Hi, Im thinking to buy the Pano2VR license but I need your cooperation to embed pano into another flash movie with ActionScript 2
I have tried with this code but there is not any pano:
Im using Adobe flash CS3
Code: Select all
var vr:MovieClip = _root.createEmptyMovieClip("vr", 1);
vr._lockroot=true;
// move the upper left corner
vr._x=100;
vr._y=200;
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;
};
myListener.onLoadInit = function () {
// your initalisation of the pano, add Hotspots,...
// You can also set the window size here but you need to use the API
vr.pano.setWindowSize(500,380);
};
myLoader.addListener(myListener);
myLoader.loadClip("mypanorama.swf", vr);
I have changed the name of the SWF pano, and is on the same folder of the main movie. What I am doing wrong?? please give me hand... Thnks
Re: Pano2VR - Flash 9 API
Posted: Sat Jan 19, 2008 10:28 pm
by twofun
Iis it possible to take fla file for flash9 tour.
Re: Pano2VR - Flash 9 API
Posted: Sat Jan 19, 2008 11:47 pm
by thomas
You need to use the code for ActionScript 3 as described in
http://gardengnomesoftware.com/wiki/Pano2VR_-_Flash_API . The ActionScript 2 code doesn't work for Flash 9 panoramas.
Re: Pano2VR - Flash 9 API
Posted: Fri Feb 15, 2008 5:38 am
by rumormill
Thomas,
What if I want the panorama to load into an empty movie clip when I press a button? What would the updated code be?
I am working in Flash 8 & AS2 on Mac OSX, and I have downloaded the latest version of Pano2VR.
Thanks for any help you provide. I have read the Wiki and still don't understand how to adjust the code to make this work.
-Kori
Re: Pano2VR - Flash 9 API
Posted: Wed Feb 20, 2008 1:30 am
by thomas
If you are using AS2 you need to export the panorama as Flash 8 within Pano2VR. You can find an example fla project at
http://gardengnomesoftware.com/samples/ ... tainer.zip
Re: Pano2VR - Flash 9 API
Posted: Wed Mar 05, 2008 7:12 am
by RealVision360
Im still can not play a flash v9 pano into another movie. I have used the API but doesn work...
We would be gratefull if you make a basic video demostration, how embed flash v9 panorama into another main movie, changing the panos trough a simple map
like this
I hope all your help
Thanks
Re: Pano2VR - Flash 9 API
Posted: Tue Mar 11, 2008 4:27 pm
by RealVision360
Hi, I did not see any help... please, give me a hand.
You can see our issue here:
http://ideartegrafico.net/temp/as3/
Here you see the the pano doesnt take the right size. The code on the first frame of the main movie is:
Code: Select all
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var loader:Loader;
loader = new Loader();
var url:String = "pano1.swf";
var urlReq:URLRequest = new URLRequest(url);
var vr:MovieClip;
function finished_loading(e:Event) {
}
function initHandler(event:Event):void {
vr = MovieClip(loader.content);
vr.x = 348;
vr.y = 152;
vr.pano.setWindowSize(425,335);
}
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE,finished_loading);
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loadFile(url);
function loadFile(fileName:String):void {
var urlReq:URLRequest = new URLRequest(fileName);
loader.load(urlReq);
addChild(loader);
}
function punto1_function(event:MouseEvent):void {
url = "pano1.swf";
loadFile(url);
}
plano_mc.punto1_bt.addEventListener(MouseEvent.CLICK, punto1_function);
function punto2_function(event:MouseEvent):void {
url = "pano2.swf";
loadFile(url);
}
plano_mc.punto2_bt.addEventListener(MouseEvent.CLICK,punto2_function);
If you see any error, please let us know...
Thanks for your help.....
Re: Pano2VR - Flash 9 API
Posted: Sun Mar 16, 2008 3:53 pm
by rakkenes
is there any way at all to load flash 9 files with AS2 ?
I do not want to re-write my whole flash as2 website, just to load this VR..
Thanks
Sverre
Re: Pano2VR - Flash 9 API
Posted: Wed Mar 19, 2008 11:25 pm
by thomas
rakkenes wrote:is there any way at all to load flash 9 files with AS2 ?
I do not want to re-write my whole flash as2 website, just to load this VR..
I don't think so... I guess the container always needs to be written in a new version of Flash.
Re: Pano2VR - Flash 9 API
Posted: Sat Mar 22, 2008 2:52 pm
by RealVision360
Hi thomas
Im still not see any usefull help here. I have made the AS3 API and doesnt works, and I did put my code, my url error, and there is no response.
Have I take the correct choice on buy Pano2VR software????
Re: Pano2VR - Flash 9 API
Posted: Sat Mar 22, 2008 5:57 pm
by thomas
RealVision360 wrote:Hi thomas
Im still not see any usefull help here. I have made the AS3 API and doesnt works, and I did put my code, my url error, and there is no response.
Have I take the correct choice on buy Pano2VR software????
Did you select Scaling="no" in the display options?