Error #1009 on Pano2VR - Flash API sample

Using Pano2VR/Object2VR SWF files with your own Flash projects
Post Reply
giloosh
Posts: 9
Joined: Tue Jul 13, 2010 9:26 pm

I follwed the sample provided on:
http://gardengnomesoftware.com/wiki/Pan ... I#Hotspots

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 get the following error:
init panorama player...
initHandler: [Event type="init" bubbles=false cancelable=false eventPhase=2]
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at vr2_fla::MainTimeline/initHandler()
I am using Flash CS3
The compiler is set to Flash Player 9 AS3

Please help :o
skaddi
Posts: 24
Joined: Thu Aug 20, 2009 2:24 pm

Hi

you have used the code for Pano2VR <= 2.1 but maybe you have Pano2VR 2.2 and above ?
giloosh
Posts: 9
Joined: Tue Jul 13, 2010 9:26 pm

I have version 2.3.4
Any code examples for that version?
skaddi
Posts: 24
Joined: Thu Aug 20, 2009 2:24 pm

Yes, the lower one starting with "Starting with Pano2VR 2.2 the ..."

http://gardengnomesoftware.com/wiki/Pan ... script_3.0
giloosh
Posts: 9
Joined: Tue Jul 13, 2010 9:26 pm

thanks. How do I access the HotSpot ID, or title. I would like to run a dynamic function based on some variable the HotSpot Holds.
For example, If I click HotSpot A it will trace the letter "A"
hfeist
Posts: 25
Joined: Tue Oct 16, 2007 11:21 pm
Contact:

I am also having problems with the Flash API example. I have version
Pano2VR 2.3.4
using Flash 10
and when attempting to add the code for detecting hotspot clicks

vr.pano.onClickQtHotspot=function(id:Number,title:String,url:String,target:String)
{
// add your code here!
trace(e + "," + title);
};

I get:

init panorama player...
initHandler
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at WENDYS3_fla::MainTimeline/finished_loading()
Anyone have a suggestion
hf
Post Reply