capture flash key event "escape"
I have开发者_StackOverflow社区 a flash site that users can view full Screen video. the trouble is, I am making only the video player full screen (hiding the rest of the site behind it).
my "toggle full screen" button works in that it reduces the video player back to normal size when the user toggles out of full screen back.
but when the user hits the escape key, my flash script doesn't know that the video player should be reduced in size.
it seems there's no way to capture the ESCAPE key as a key event. any ideas?
Register for this event:
this.stage.addEventListener( flash.events.FullScreenEvent.FULL_SCREEN , this.noticeDisplayState );
Then handle it:
public function noticeDisplayState( inEvent:Event ) {
if ( this.stage.displayState != StageDisplayState.FULL_SCREEN ) {
// escape key pressed
}
}
Try this page: http://www.actionscript.org/forums/archive/index.php3/t-9762.html
精彩评论