Load different panoramas with button Flash 9 AS3

Using Pano2VR/Object2VR SWF files with your own Flash projects
Post Reply
slowhand1980
Posts: 7
Joined: Tue Feb 09, 2010 12:10 pm

Hi, I have a question for you. In this flash movie:

http://ytrid.altervista.org/

I have a pano preloaded, and I want to use it.
Now, if I want to change pano by clicking on a button in the flash movie (ie: SERVIZI) how I have to modify my AS3?

Another question.... why the control bar appear on the left outside of the pano's windows?

Thank you


My code:

Code: Select all

import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var loader:Loader;
loader = new Loader();
var url:String = "panoramiche/pano.swf";
var urlReq:URLRequest = new URLRequest(url);
var vr:MovieClip;

function finished_loading (e:Event) {
}

function initHandler(event:Event):void {
	trace("initHandler: " + event);
	vr = MovieClip(loader.content); 
	vr.isFlash10=false; 

function initPanorama(e:Event) {
	if ((vr!=null) && (vr.pano!=null)) {
		removeEventListener( Event.ENTER_FRAME , initPanorama);
		vr.pano.setWindowSize(1280,313); 
		vr.pano.setWindowPos(0,0); 
	}
}

addEventListener( Event.ENTER_FRAME , initPanorama);

loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, finished_loading);
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.load(urlReq);
addChild(loader); 
slowhand1980
Posts: 7
Joined: Tue Feb 09, 2010 12:10 pm

ehi ehi?!? Someone can help me? I've buyed this software but I can't obtain any kind of support! I'm trying to obtain it for a long time before!!!
User avatar
360Texas
Moderator
Posts: 3684
Joined: Sat Sep 09, 2006 6:06 pm
Location: Fort Worth, Texas USA
Contact:

Hi Slowhand1980.
I see you joined the forum yesterday 09Feb2010.
You have made 2 comments.

Welcome to the forum.

I did visit your site. Appears that the hotspot dots are not actively connected to your upper right corner flash viewer.

I am not sure if this is a Pano2VR question or a Flash CS4 authoring program question.

Are you working in FLASH CS4 authoring program ?
Dave
Pano2VR Forum Global Moderator
Image
Visit 360texas.com
slowhand1980
Posts: 7
Joined: Tue Feb 09, 2010 12:10 pm

First of all, yes, I joined the forum only yesterday, but I've buyed the software on november '09 and I've tryed to contact the support via email with no result....

then... yes, I'm using flash CS4.
Now I've changed the layout of my site and I've cut out the controls of the panos. But I still can't create some buttons to change different panos. I've tryed to put the code on different keyframes and call the panos with "gotoandstop", but this doesn't work!!!
User avatar
360Texas
Moderator
Posts: 3684
Joined: Sat Sep 09, 2006 6:06 pm
Location: Fort Worth, Texas USA
Contact:

I will suggest to Thomas [forum owner] - that we start a Adobe Flash CS4 authoring software and AS2/3 topic list. AS2/3 and Flash CS4 authoring program are getting mixed into Pano2VR topics.

Talking about AS2/3 and Flash authoring is confusing for those only wanting to learn about Pano2VR functionality.
Dave
Pano2VR Forum Global Moderator
Image
Visit 360texas.com
slowhand1980
Posts: 7
Joined: Tue Feb 09, 2010 12:10 pm

Ok, I've understand this.... but the issue concerne the Flash API of Pano2VR, not Flash CS4 in the specific.

By the way, can someone help me with my question?
User avatar
360Texas
Moderator
Posts: 3684
Joined: Sat Sep 09, 2006 6:06 pm
Location: Fort Worth, Texas USA
Contact:

I trust some forum member can help you with this issue.

Thank you for bringing this issue to our attention.
Dave
Pano2VR Forum Global Moderator
Image
Visit 360texas.com
slowhand1980
Posts: 7
Joined: Tue Feb 09, 2010 12:10 pm

OK, I really hope that someone can help me, I've sponsored this software in my university-lab, now I have to justify the lack of user's support!
User avatar
k.ary.n
Gnome
Posts: 615
Joined: Wed Aug 15, 2007 1:02 pm

Why not just use the Skin Editor? ;)

Have you read this article: http://gardengnomesoftware.com/wiki/Pano2VR_-_Flash_API? I don't see anything using the Event "goToAndStop". (I'm probably wrong here, but wasn't goToAndStop depreciated in AS3?)
slowhand1980
Posts: 7
Joined: Tue Feb 09, 2010 12:10 pm

so you tell me I have to create different keyframe and paste on them this code:

Code: Select all

import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var loader:Loader;
loader = new Loader();
var url:String = "panoramiche/pano.swf";
var urlReq:URLRequest = new URLRequest(url);
var vr:MovieClip;

function finished_loading (e:Event) {
}

function initHandler(event:Event):void {
   trace("initHandler: " + event);
   vr = MovieClip(loader.content);
   vr.isFlash10=false;

function initPanorama(e:Event) {
   if ((vr!=null) && (vr.pano!=null)) {
      removeEventListener( Event.ENTER_FRAME , initPanorama);
      vr.pano.setWindowSize(1280,313);
      vr.pano.setWindowPos(0,0);
   }
}

addEventListener( Event.ENTER_FRAME , initPanorama);

loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, finished_loading);
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.load(urlReq);
addChild(loader); 
then I call the frame with gotoAndStop?

I tell you this because I've tried thism byt Flash tell me there is a duplicated function!!!
slowhand1980
Posts: 7
Joined: Tue Feb 09, 2010 12:10 pm

ok, I've tried with this:

Code: Select all

import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var loader:Loader;
loader = new Loader();
var url:String="panoramiche/piazza.swf";
var urlReq:URLRequest=new URLRequest(url);
var vr:MovieClip;

function finished_loading(e:Event) {
}

function initHandler(event:Event):void {
	trace("initHandler: " + event);
	vr=MovieClip(loader.content);
	vr.isFlash10=false;
}

function initPanorama(e:Event) {
	if ((vr!=null) && (vr.pano!=null)) {
		removeEventListener( Event.ENTER_FRAME , initPanorama);
		vr.pano.setWindowSize(654,290);
		vr.pano.setWindowPos(0,0);
	}
}

addEventListener(Event.ENTER_FRAME , initPanorama);

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);
}

loc_mag_1.addEventListener(MouseEvent.CLICK, punto1_function);
function punto1_function(event:MouseEvent):void {
   url = "panoramiche/piazza.swf";
   loadFile(url);
}

loc_mag_2.addEventListener(MouseEvent.CLICK,punto2_function);
function punto2_function(event:MouseEvent):void {
   url ="panoramiche/aulamm.swf";
   loadFile(url);
}
Now I'm able to change the pano's source, but when I click on the button loc_mag_1 or loc_mag_2 the pano change, but the size of the pano change to fullscreen!!!! Why this? What I do of wrong?!?!?!?
Fabio
Posts: 1
Joined: Sun Jan 09, 2011 5:16 pm

Hello everyone, I'm new to the forum. I'm trying to also manage to create a very simple menu all in flash with little thumbails pano to click for opening the corresponding pano in big. Everything is working good and I manage to load another pano swf with a button in AS3. The only thing is that when any new pano is loaded he's taking all the space available in my main swf and i can't see my thumbails menu anymore... I tried to reset the size and position but still nothing change... Help !
Post Reply