Triggering Function when start
Hi guys,
I am having a problem with Flash AS3 function triggering.
I have a function name " Full screen mode ". It only trigger when a button is clicked.
Is it possible to trigger the full screen function whenever the flash start without clicking the button?
Quote:
flashmo_fullscreen.visible = true;
stage.addEventListener( Event.RESIZE, resize_listener );
stage.dispatchEvent( new Event( Event.RESIZE ) );
function resize_listener( e:Event ): void
{
flashmo_fullscreen.x = stage.stageWidth - 29;
flashmo_fullscreen.y = stage.stageHeight - 61;
}
flashmo_fullscreen.addEventListener( MouseEvent.CLICK, switch_screen_mode );
function switch_screen_mode( me:MouseEvent )
{
if( stage.displayState == StageDisplayState.NORMAL )
stage.displayState = StageDisplayState.FULL_SCREEN;
else
stage.displayState = StageDisplayState.NORMAL;
}
Thanks in advance.