full-screen mode in Actionscript 2

How to use full-screen mode in Actionscript 2:

_root.btn_mc.onRelease = function(){
    if(Stage["displayState"] == "normal"){
        Stage["displayState"] = "fullScreen";
        Stage["displayState"] = "normal";

var listener:Object = {};
listener.onFullScreen = function(isFullscreen:Boolean){
        trace("entered full-screen mode");
        trace("exited full-screen mode");

Also see Exploring full-screen mode in Flash Player 9.

2 Responses to “full-screen mode in Actionscript 2”

  1. Andrei Bouaru says:

    Thanks! Thanks! Thanks!
    I’ve been looing for a way to find out if the swf container for my application is fullscreen or not to make some adjustments in the included swf…and your method does that perfectly …thanks again

  2. Geoff Hunt says:

    Perfect! Just what I was looking for. Short simple, and does a great job of going from fullscreen to normal screen with the listener.