A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Full Screen Mode - Esc Messes Up My Toggle Switch??

  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    73

    resolved [RESOLVED] Full Screen Mode - Esc Messes Up My Toggle Switch??

    I have a toggler icon to switch between full screen and normal screen. When the user is in normal screen the icon is a plus sign and when in full screen the icon is a minus sign.

    This works fine until the user presses escape to exit full screen mode. Doing this doesn't cause the icon to switch back.

    I have a movieClip called toggler with two frames, one containing the plus, the other the minus sign.

    Code:
    function toggleFullScreen(){
    
      if(Stage["displayState"]=="normal"){
    	toggler.gotoAndStop(2);
    	Stage["displayState"]="fullScreen";
      }else{
    	toggler.gotoAndStop(1);
        Stage["displayState"]="normal";
      }
    }
    
    var resizeListener:Object = new Object();
    
    resizeListener.onResize = function () {
    
      toggleFullScreenButton._x=Stage.width/2;
      toggleFullScreenButton._y=Stage.height/2;
    }
    
    Stage.addListener(resizeListener);
    
    toggler.onRelease = function() {
      toggleFullScreen();
    }
    How could I get around this???

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    use the Stage.onFullScreen handler:

    http://help.adobe.com/en_US/AS2LCR/F...40.html#478896

    gparis

  3. #3
    Member
    Join Date
    Jul 2008
    Posts
    73
    Like this?
    Code:
    onFullScreen = function(bFull: Boolean) {
      if(Stage["displayState"]=="normal"){
    	toggler.gotoAndStop(2);
    	Stage["displayState"]="fullScreen";
      }else{
    	toggler.gotoAndStop(1);
        Stage["displayState"]="normal";
      }
    }
    
    var resizeListener:Object = new Object();
    
    resizeListener.onResize = function () {
    
      toggleFullScreenButton._x=Stage.width/2;
      toggleFullScreenButton._y=Stage.height/2;
    }
    
    Stage.addListener(resizeListener);
    
    toggler.onRelease = function() {
      onFullScreen();
    }
    If so, it toggles the between full and normal screen but I'm still having the same problem with the icon. Do you understand what the problem is?

  4. #4
    Member
    Join Date
    Jul 2008
    Posts
    73
    OK. Got it. Thanks
    Code:
    onFullScreen = function(bFull: Boolean) {
      if(Stage["displayState"]=="normal"){
    	Stage["displayState"]="fullScreen";
      }else{
        Stage["displayState"]="normal";
      }
    }
    var resizeListener:Object = new Object();
    resizeListener.onResize = function () {
      if(Stage["displayState"]=="normal"){
    	toggler.gotoAndStop(1);
      }else{
    	toggler.gotoAndStop(2);
      }
    }
    
    Stage.addListener(resizeListener);
    
    toggler.onRelease = function() {
      onFullScreen();
    }

Tags for this Thread

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