Pano2VR - Flash 9 API

Q&A about the latest versions
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

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
MfG, Thomas
ricardo
Posts: 23
Joined: Tue Nov 21, 2006 11:33 pm

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

Zooming = changing the FoV so for example <panoclip>.pano.changeFov(-1.0); will zoom in.
MfG, Thomas
refocus
Posts: 1
Joined: Fri Jan 11, 2008 1:49 pm

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.
RealVision360
Posts: 4
Joined: Sat Jan 19, 2008 2:05 am

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 :D
twofun
Posts: 2
Joined: Sat Jan 19, 2008 9:22 pm

Iis it possible to take fla file for flash9 tour.
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

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.
MfG, Thomas
rumormill
Posts: 10
Joined: Thu Feb 14, 2008 3:21 am

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

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
MfG, Thomas
RealVision360
Posts: 4
Joined: Sat Jan 19, 2008 2:05 am

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
Image
I hope all your help
Thanks
RealVision360
Posts: 4
Joined: Sat Jan 19, 2008 2:05 am

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.....
rakkenes
Posts: 3
Joined: Sun Mar 16, 2008 3:50 pm

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

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.
MfG, Thomas
RealVision360
Posts: 4
Joined: Sat Jan 19, 2008 2:05 am

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

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?
MfG, Thomas
Post Reply