Hi
I'm having a problem with this code for selecting a character for a game. The scrolling left and right codes work but when it comes to accepting the highlighted character, I get this;
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at KnockoutGame_fla::MainTimeline/selectArc()
All I want is for it to take the label of the current frame in the movie clip (which I defined already) and set it to a string, selectedChar.
This is my code;
Code:
this.stop();
var selectedChar:String = "";
var backMusic:SoundChannel;
var target:MovieClip;
var gameTimer:Timer = new Timer(1000,1);
p1c.gotoAndStop("Adeiza");
target = p1c;
backMusic= (new BackMusic2()).play();
available = new Array(2,3,4,5);
sButton.addEventListener(MouseEvent.CLICK, selectArc);
gameTimer.addEventListener(TimerEvent.TIMER, game);
function game(evt:TimerEvent):void {
nextFrame();
}
function selectArc(evt:MouseEvent):void {
selectedChar=target.currentFrameLabel;
gameTimer.start();
}
p1c is an instance of the movieClip containing the characters. I'd really appreciate any help or ideas. Thanks