A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Triggering Function when start

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    6

    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?
    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.

  2. #2
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    Unfortunately, not possible.

    "In Flash Player, full-screen mode can only be initiated through ActionScript in response to a mouse click (including right-click) or keypress"

    http://help.adobe.com/en_US/ActionSc...3446FBEEB.html
    Last edited by ilike2; 08-02-2012 at 12:43 PM. Reason: typo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center