all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

toggle key command



toggle key command g5604
11/27/2004 5:25:26 PM
flash actionscript: Hi,

is it possible to toggle the actions of a key press so.

so press "m" once gotoAndPlay (2)
press "m" twice gotoAndPlay (1)

cheers,
G

Re: toggle key command NSurveyor
11/27/2004 6:03:48 PM
sure, why not:
mcontrols = 1;
someListener = new Object();
someListener.onKeyUp = function () {
if(Key.getCode()==77){
mcontrols = -mcontrols
if(mcontrols == -1){
gotoAndPlay(1);
}else{
gotoAndPlay(2);
}

}
};
Key.addListener(someListener);
Re: toggle key command g5604
11/27/2004 7:31:27 PM
Re: toggle key command NSurveyor
11/27/2004 7:35:51 PM
AddThis Social Bookmark Button