A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Disable FullScreen [AS3]

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    5

    Disable FullScreen [AS3]

    Hi there,

    I want to automatically disable the ability for people to switch to FullScreen when watching my Flash animation. The animation will be downloaded by people and viewed in FlashPlayer rather than in a web browser, if that makes a difference.

    Here is the Code I have tried so far:

    Code:
    stage.addEventListener(Event.ENTER_FRAME, DisableFS);
    
    function DisableFS(event:Event):void {
    	stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullscreenOff);
    }
    
    function fullscreenOff(event:FullScreenEvent):void {
        if stage.displayState == StageDisplayState.FULL_SCREEN; {
    		stage.displayState = StageDisplayState.NORMAL;
    	}
    }
    Something I drew up myself, but with no success. Does anyone know what's up?

  2. #2
    Junior Member
    Join Date
    Mar 2012
    Posts
    5
    I take it from the dead silence that this isn't possible in Flash?

  3. #3
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You can remove the eventlistener and once the animation is finished or clicked off you create the listener newly.
    - The right of the People to create Flash movies shall not be infringed. -

  4. #4
    Junior Member
    Join Date
    Mar 2012
    Posts
    5
    I don't understand CiF? What do you mean?

  5. #5
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You must have some eventlistener, which allows switching your screen to full screen. You need to remove that listener.
    - The right of the People to create Flash movies shall not be infringed. -

  6. #6
    Junior Member
    Join Date
    Jun 2011
    Posts
    26
    FullScreenEvent.FULL_SCREEN event is called when swf is already in full screen mode so you will have blinking effect.

    You should add stage.addEventListener(FullScreenEvent.FULL_SCREEN , fullscreenOff) only once and not every enter_frame event.
    Esquimo - Flash 3D

  7. #7
    Junior Member
    Join Date
    Mar 2012
    Posts
    5
    I hope people aren't confused by what I mean. I'm talking about the equivalent of the "maximise" button on an open windows file, or the small green "+" on a Mac. I'm starting to think I'm using the wrong code here.

    CiF, I don't have anything that switches to fullscreen.

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