I've got the Error #1009
in my project and it pisses me off.
My problem in null object reference. Especially in array. I declare movie clip into an array. But the result is null. Name of my movie clip (instance) its match.
Here is my full code:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.trace.Trace;
import fl.transitions.Tween;
import fl.transitions.easing.*;
public class Level extends MovieClip {
public var dragArray:Array = [obj1, obj2;
public var obstacleArray:Array = [obs_obj];
public var matchArray:Array = [obj1target, obj2target];
public var currentClip:MovieClip;
public var startX:Number;
public var startY:Number;
public function Level() {
// constructor code
trace(dragArray);
var tween:Tween = new Tween (tutorial,'x',Bounce.easeOut,918.9,720,0.7,true)
var dragGame:DragGame = new DragGame(stage, dragArray, matchArray);
dragGame.addEventListener(DragGame.MATCH_MADE, onMatch);
dragGame.addEventListener(DragGame.NO_MATCH, onFlub);
dragGame.addEventListener(DragGame.ALL_DONE, onDone);
function onMatch(event:Event):void {
//var matchSound:Sound = new MatchSound();
//matchSound.play();
trace("Match");
}
function onFlub(event:Event):void {
//var flubSound:Sound = new FlubSound();
//flubSound.play();
trace("Flub");
}
function onDone(event:Event):void {
}
}
}
}
I can't call DragGame()
, I'm using trace in my array, it only shows (",")
. I assume my array is null.
Can someone help me?