FullScreen using ContextMenu

I had, long back written a post on how to take an application full screen. This is an extension to that. What I am doing is adding the “Go Full Screen” and “Exit Full Screen” buttons on the Context Menu itself (ContextMenu is the Menu that appears on the right click on a Flash Movie). It is a simple application with just an image in it, which is purposely stretched to 100% (using the maintainAspectRatio and scaleContent properties on the Image control).

Application | Source

Note: You will still need to alter the HTML Template to accommodate the full screen as mentioned in this post

Update March 07 2008: A lot of people have complained that they got a security error when they tried using the code above. Here is a post articulating the problem and the solution.


12 Responses to FullScreen using ContextMenu

  1. Srikanth V says:


    If I apply this full screen mode to an flex application instead of video, I am unable to type into the text field. can you please tell me a work around or fix for the text field to work.

    ~ Srikanth

  2. raghunathrao says:

    @Srikanth – As far as i know it is designed that way and all keyboard interactions are disabled in the fullscreen mode. The document on this in the Adobe site says the following…
    “Users cannot enter text in text input fields while in full-screen mode. All keyboard input and key-related ActionScript is disabled while in full-screen mode, with the exception of the keyboard shortcuts that take the viewer out of full-screen mode”

  3. Kanu Wadhwa says:

    I’m getting this error on clicking on “go to fullscreen”
    SecurityError: Error #2152: Full screen mode is not allowed.
    at flash.display::Stage/set displayState()
    at txt/::goFullScreen()
    Can you pls tell me how to solve this?

  4. amarghosh says:

    i am developing an ActionScript application in Flex Builder 3 beta 3 and i have the following line in my code:

    stage.displayState = StageDisplayState.FULL_SCREEN;

    whenever i run/debug this application, i am getting Error #2152.
    i modified the html template (html-template\index.template.html, right?) and still no improvement 😦
    it runs without any problem in fullscreen when i run it on a standalone player.
    but in a browser (both ie 6 and firefox 2) i am getting this error.

    can u help me?

  5. Nick says:

    i am using ASctionScript3.0 to develop FLVPlayer with fullscren option
    when i use fullscreen option i got error #2152 full screen mode not allowed
    how can i solve this?

    pls help me

  6. raghunathrao says:

    @i Nick, Kanu & Amarghosh – This should solve your problems…

  7. […] significance in Flex Project Development I had posted a couple of posts earlier (the iFrame, contextMenu based fullscreen & the fullScreenVideo) where it required you to edit the html in which the Flex App SWF is […]

  8. Megha says:

    I am trying to remove TextArea default contextMenu that is cut,copy,paste,delete,selectAll.I want add my custom Context Menu which only shows Select All and by clicking on Select All I have to handle one function.Can you help me in removing the TextArea default contextMenu?

  9. subhrajit says:

    Your discussion and example on focusOut was of immense help.I was facing a similar problem and had to really scratch my head to get a solution.I applied the solution mentioned and it worked.thanks

  10. anthony says:

    thanks mate, your tutorial helped me bigtime. all the best

  11. Thanks for the nice fix, this is the same issue we faced in our project.

  12. Gaurav says:

    hey guys,

    is it possible to disable the default context menu on TextArea? i want to disable the cut, copy paste functionality and put my own functionality in there. i am able to remove the default behavior at the application level but i m finding it difficult to do it on the component level. kindly do the needful.

    thanks n advance.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s