Actionscript and key presses
Basically Im making a video phone menu. I have several labelled items along the timeline with movies in them. I have some of the keypads keys programmed to goto a certain point by stating the label name along the timeline.
So far so good.
Yet, for some reason, flash "accumulates" the keypress actions as it returns to an earlier point on the timeline. I put traces on them and noticed it would also print out the previous keypress action and would play that action if it goes back past the previous labelled item it was on.
Its a bit difficult to explain and I cant really post the file.
Currently going to a labelled frame is like so:
stage.addEventListener(KeyboardEvent.KEY_UP,fl_KeyboardDownHandler_9);
function fl_KeyboardDownHandler_9(event:KeyboardEvent):void
{
if (event.keyCode==99)
{
trace("3 pressed from Menu");SoundMixer.stopAll();
MovieClip(this.root).gotoAndStop("Directory Screen");
}}
So if I press keycode 99, the trace above will show but also the previous trace.
Is there some code that can clear the last used keypress variable or something? This is really frustrating.
Thanks.