Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

viewinz

Fortgeschrittener

  • »viewinz« ist der Autor dieses Themas

Beiträge: 145

Wohnort: Wellington, New Zealand

Beruf: Trying to build an entire walkthrough of NZ for tourists

  • Nachricht senden

1

Freitag, 14. August 2009, 06:24

Error:1009 simple actionscript problem I think!

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.



Quellcode

1
2
3
4
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?


Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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;
	
...


There is a lot more here but the error seems to be coming from the init(); function

2

Freitag, 14. August 2009, 17:17

I'm guessing the problem is because you are using addEventListeners() without an object reference. If I'm not mistaken, you add an event listener to a display object - like a button or text field object, or a display object container - like the stage or a movie clip, or root...

3

Samstag, 15. August 2009, 16:23

viewinz, show us the content of addEventListeners function

michael360, you mix up addEventListeners and addEventListener (without the s). addEventListeners is probably a personnal function.
VideoStitch, a video stitching engine / blog sur les visites virtuelles ( french ).