Hey all!
I’m a new user to AS3 and I need some help.
I’ve created a fun little puzzle game and I’d like it to time how long it takes for you to complete each level and then allow you to click onward to the next level.
So, ideally, once the level is complete, I’d like a box to display your time and then let you move on with the click of a button.
I know it’s gonna be something like this: [COLOR=#1C1C1B][FONT=Courier New]myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete);[/FONT][/COLOR]
[COLOR=#1C1C1B][FONT=Courier New]function onComplete(e:TimerEvent):void {
[/FONT][/COLOR]But I’m confused as to how I can accomplish what I want. Sorry if this isn’t enough info, I’m really new at this.
Thanks so much in advance!
And here’s my main function, in case its needed:
public function Main() {
txtWins=new TLFTextField();
txtWins.x=903.95;
txtWins.y=5;
txtWins.width=62;
txtWins.height=29.15;
addChild(txtWins);
txtWins.text=“0”;
loadGame();
addChild(laserCanvas);
placeDraggables(false);
placeTargets(false);
shuffleDraggables();
drawLaser();
overSound=new over();
levelDoneSound=new levelDone();
backgroundMusic = new BackgroundMusic();
bgmSoundChannel = backgroundMusic.play();
bgmPlaying = true;
bgmSoundChannel.addEventListener(Event.SOUND_COMPLETE, bgmSoundComplete);
stage.addEventListener(MouseEvent.MOUSE_MOVE,moving);
btnMute.addEventListener(MouseEvent.CLICK, btnMuteClicked);
btnReplay.addEventListener(MouseEvent.CLICK, btnReplayClicked);
txtWins.addEventListener(Event.ADDED_TO_STAGE, txtWinsAdded);
}