Stacking order

Using Pano2VR/Object2VR SWF files with your own Flash projects
Post Reply
gwindle
Posts: 26
Joined: Mon Jan 25, 2010 10:53 pm

I have an AS3 flash movie that imports and displays a pano built with pano 2VR 3.0.

How do I make other Flash content display over the top of the pano that was imported?

I have a drop down menu built in Flash that I want to display on top of the pano.

Everything is covered by the pano?

Code: Select all

stop();
/*var myLoader:Loader = new Loader(); 
addChild(myLoader); 
var url:URLRequest = new URLRequest("park.swf"); 
myLoader.load(url); */

import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;

var loader:Loader = new Loader();
var url:String = "Panorama_out.swf";
var urlReq:URLRequest = new URLRequest(url);
var vr:MovieClip; // panorama 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.isFlash10=false; // Disable Flash 10 rendering if the container is Flash 9
}

function initPanorama(e:Event) {
// check if the panorama object is available and initialize it
	if ((vr!=null) && (vr.pano!=null)) {
		removeEventListener( Event.ENTER_FRAME , initPanorama);
		vr.x=0;
		vr.y=70;
		vr.pano.setWindowSize(920,335);
//--------------------------------------------
		vr.pano.onClickHotspot=function(id:String,obj:Object,url:String,target:String) {
			// add your code here!
			gotoAndStop(2);
			trace("Point Hotspot:" + id);
			if (id == "Park_02")
			{
			gotoAndStop(3);
			}
		}
//--------------------------------------------
	}
}
// call initPanorama every frame
addEventListener( Event.ENTER_FRAME , initPanorama);

// Tell the loader to call 'finished_loading' after the swf is loaded.
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, finished_loading);
// Tell the loader to call 'initHandler' after the swf is initialized.
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.load(urlReq);
addChild(loader); // add your swf directly to the stage

myButton.addEventListener(MouseEvent.MOUSE_UP, myButtonUp);

function myButtonUp (event:MouseEvent):void{
	trace("Hello World");
	gotoAndStop(2);
}

myButton2.addEventListener(MouseEvent.MOUSE_UP, myButtonUp2);

function myButtonUp2 (event:MouseEvent):void{
	trace("Hello World");
	gotoAndStop(3);
}
Noisy
Posts: 35
Joined: Wed Apr 04, 2007 12:49 am
Location: Scotland

assuming your menu is "park.swf" (or contained in it) you are adding that to the stage first and then placing your pano over the top of it if you call 'addChild(myLoader);' again, or move it below 'addChild(loader);' in your code. it will place "myLoader" to the top of the display list.
Post Reply