1 Reply Latest reply on May 4, 2009 3:21 PM by BadXhampill

    Setting an object to the corner of the screen

    BadXhampill

      I have a button control set up to switch my program from windowed mode to fullscreen, and back again.

       

      This is just 2 buttons that alternate frames in a movieclip.

       

      I was wondering if there was a way to keep the movieclip locked to the upper right corner of the program when the user switches between windowed and fullscreen modes.

       

      The code for the buttons; if needed, is:

       

      //Fullscreen button

      on (press) {
      fscommand("FullScreen","True");
      }
      on (release) {
      gotoAndStop(2);
      }

       

      //Window button

      on (press) {
      fscommand("FullScreen","False");
      }
      on (release) {
      gotoAndStop(1);
      }

        • 1. Re: Setting an object to the corner of the screen
          BadXhampill Level 1

          Plugging away on this still.  I have been able to successfully get my button to snap to the right edge of my program when the button is clicked for fullscreen.  But when I click the button again to go back to windowed mode, the button moves farther than required.

           

          Here is my updated code

           

          //Fullscreen button

          on (press) {
          fscommand("FullScreen","True");
          _parent.SWidth = stage.width;
          }

          on (release) {
          _parent.SWidth = stage.width;
          _parent.ScreenBtn._x = (_parent.Swidth -= 140);
          gotoAndStop(2);
          }

           

          //Windowed button

          on (press) {
          fscommand("FullScreen","False");
          _parent.SWidth = stage.width;
          }

          on (release) {
          _parent.SWidth = stage.width;
          _parent.ScreenBtn._x = (_parent.Swidth -= 140);
          gotoAndStop(1);
          }

           

          I reset the Var "SWidth" both on press and release because I was having an issue with it registering depending on how fast I released my mouse; and this seemed to aleviate it.

           

          I think the biggest thing that would help is if someone knows the code to return the value for the width of the window.  I think that is what I am missing.  I haven't even startede working on height yet; mostly because I would assume the process to be the same.