Need some help with frame events [EASY]

Need some help with frame events [EASY]

Hi every one I’m trying to get some practice with frame labels and just normal frames. In this code I’m have the first part working when the play head gets to the frame label “test” it traces “You got it working!”. But the next part is where I’m losing it. I would like to have a second trace statement execute when the play head gets to the final frame (frame 40) I have also attached a stop action on frame 40. I tried to set up a var for finalFrame to = frame 40 but it didn’t work here is the error I’m getting.

1176: Comparison between a value with static type String and a possibly unrelated type Number.


stage.addEventListener(Event.ENTER_FRAME, checkFrame,false,0,true);
stage.addEventListener(Event.ENTER_FRAME, endCode,false,0,true);
var finalFrame:Number = 40;

function checkFrame(event:Event):void 
{
     if (currentLabel == "test")
        {
            trace("You got it working!");
        }
}
    
function endCode(event:Event):void 
{
     if (currentLabel == finalFrame)
        {
            trace("I've stopped and ended playback");
        }
}


Any ideas on what I’m over looking would be most helpful thank you for your help

John