Hi,
I'm trying impliment a simple map viewer I've aquired, that has some nice effects over and above the google map plug in.
When I've added it to the flash CS3 example plugin to get it working I'm getting this error which is stopping me get any further.
Code
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flashcs3exampleplugin1_fla::OokMapViewer_81/addEventListeners()
at flashcs3exampleplugin1_fla::OokMapViewer_81/init()
at flashcs3exampleplugin1_fla::OokMapViewer_81/frame1()
It seems to be something to do with the 'addEventListeners().
It's probably something quite obvious, anyone got any ideas?
Code
stop();
//Stop the main timeline.
var castedRoot:MovieClip = MovieClip(root);//Cast the root to stop the timeline until all assets are loaded
castedRoot.stop();//Stop at the first frame
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.ui.Keyboard;
import flash.ui.Mouse;
import flash.filters.DropShadowFilter;
import krpano_as3_interface;
// create krpano as3 interface object - krpano
var krpano:krpano_as3_interface = krpano_as3_interface.getInstance();
const KEY_X:uint = 88;
const KEY_Z:uint = 90;
//Keyboard map direction flags
var goingLeft:Boolean = false;
var goingRight:Boolean = false;
var goingUp:Boolean = false;
var goingDown:Boolean = false;
//Keyboard map scrolling speed and home easing speed
var movingSpeed:Number = 15;
var easingSpeed:Number = .2;//Speed of easing to home
var easingToHome:Boolean = false;
//Maximum and minimum zoomable levels
var maxZoom:Number = 2;//Maximum zoom level
var minZoom:Number = .5;//Minimum zoom level
var zoomStep:Number = .02;//Zoom value for each of the mouse wheel scroll
var defaultZoomLevel:Number = 1; //Set startup map scale heres
var zoomingIn:Boolean = false;
var zoomingOut:Boolean = false;
//Store radian
var adjustToPreviousRadian:Number = 0;
var rotateMap:Boolean = false;
var northAngle:Number;
//Home and map Filter
var dropShadowFilter:DropShadowFilter = new DropShadowFilter(4, 45, 0, .2, 8, 8);
var filterArray:Array = [dropShadowFilter];
//Create new map
var map:Map = new Map();
//map.filters = filterArray;//Apply filter to the map (for fast CPU)
var home:Home = new Home();
//home.filters = filterArray;//Apply filter to the home (for fast CPU)
var target:Point;
//Compass
var compass:Compass = new Compass();
//Hide Map viewer frame, set to 1 if you want to display the frame
body.alpha = 1;//Set 0 to hide it, you still can rotate the map
//initiate program
init();
function init():void {
//Add all neccessary event listeners
addEventListeners();
//Create mask for compass
var compassMask = new Mask();
glass.doubleClickEnabled = true;
...
Display More
There is a lot more here but the error seems to be coming from the init(); function