Stacking order

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

Mon Jun 06, 2011 7:29 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

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

import flash.display.*;

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.pano.onClickHotspot=function(id:String,obj:Object,url:String,target:String) {
			// add your code here!
			trace("Point Hotspot:" + id);
			if (id == "Park_02")
// call initPanorama every frame
addEventListener( Event.ENTER_FRAME , initPanorama);

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

myButton.addEventListener(MouseEvent.MOUSE_UP, myButtonUp);

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

myButton2.addEventListener(MouseEvent.MOUSE_UP, myButtonUp2);

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

Sun Jun 12, 2011 12:03 am

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