Thanks for the quick reply, would removing the event listener work after the key has been pressed once only ya? Like basically instead of the sensor triggering the key G for example, it triggers it by going G G G G again and again as the sensor is a motion detector, so would removing the event listener prevent this from restarting the swf a number of times?
yep - if you remove the listener inside the handler function then it will get removed once a key is pressed. something like this:
stage.addEventListener(KeyboardEvent, handler);
function handler(event:KeyboardEvent):void
{
stage.removeEventListener(KeyboardEvent, handler);
//launch swf
}
(once you remove the listener, there is no way for the handler function to get called again, so the swf launch will only happen once)