2 Replies Latest reply on Oct 17, 2011 10:20 AM by kglad

    as3 to as2

    Venkom Level 1

      Can u please convert any one this script as3 to as2

       

       

      stage.scaleMode     = StageScaleMode.NO_SCALE;
      stage.align          = StageAlign.TOP_LEFT;
           mcVideoControls.btnFullscreenOn.addEventListener(MouseEvent.CLICK, fullscreenOnClicked);
           mcVideoControls.btnFullscreenOff.addEventListener(MouseEvent.CLICK, fullscreenOffClicked);
           stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreen);
           mcVideoControls.btnFullscreenOff.visible = false;
      function fullscreenOnClicked(e:MouseEvent):void {
           stage.displayState = StageDisplayState.FULL_SCREEN;
      }
      
      function fullscreenOffClicked(e:MouseEvent):void {
           stage.displayState = StageDisplayState.NORMAL;
      }
      
      if (e.fullScreen) {
      mcVideoControls.btnFullscreenOn.visible = false;
                mcVideoControls.btnFullscreenOff.visible = true;
      
                mcVideoControls.x = (Capabilities.screenResolutionX - 440) / 2;
                mcVideoControls.y = (Capabilities.screenResolutionY - 33);
      
                vidDisplay.height = (Capabilities.screenResolutionY - 33);
                vidDisplay.width = vidDisplay.height * 4 / 3;
                vidDisplay.x     = (Capabilities.screenResolutionX - vidDisplay.width) / 2;
       } else{
      
      mcVideoControls.btnFullscreenOn.visible = true;
                mcVideoControls.btnFullscreenOff.visible = false;
                mcVideoControls.x = 0;
                mcVideoControls.y = 330;
                vidDisplay.y = 0;
                vidDisplay.x = 0;
                vidDisplay.width = 440;
                vidDisplay.height = 330;
      }
      }
      
        • 1. Re: as3 to as2
          Venkom Level 1

          i forgot one line

          now added in this script

           

           

          stage.scaleMode     = StageScaleMode.NO_SCALE;
          stage.align          = StageAlign.TOP_LEFT;
               mcVideoControls.btnFullscreenOn.addEventListener(MouseEvent.CLICK, fullscreenOnClicked);
               mcVideoControls.btnFullscreenOff.addEventListener(MouseEvent.CLICK, fullscreenOffClicked);
               stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreen);
               mcVideoControls.btnFullscreenOff.visible = false;
          function fullscreenOnClicked(e:MouseEvent):void {
               stage.displayState = StageDisplayState.FULL_SCREEN;
          }

          function fullscreenOffClicked(e:MouseEvent):void {
               stage.displayState = StageDisplayState.NORMAL;
          }

           

          function onFullscreen(e:FullScreenEvent):void {
          if (e.fullScreen) {
          mcVideoControls.btnFullscreenOn.visible = false;
                    mcVideoControls.btnFullscreenOff.visible = true;

                    mcVideoControls.x = (Capabilities.screenResolutionX - 440) / 2;
                    mcVideoControls.y = (Capabilities.screenResolutionY - 33);

                    vidDisplay.height = (Capabilities.screenResolutionY - 33);
                    vidDisplay.width = vidDisplay.height * 4 / 3;
                    vidDisplay.x     = (Capabilities.screenResolutionX - vidDisplay.width) / 2;
          } else{

          mcVideoControls.btnFullscreenOn.visible = true;
                    mcVideoControls.btnFullscreenOff.visible = false;
                    mcVideoControls.x = 0;
                    mcVideoControls.y = 330;
                    vidDisplay.y = 0;
                    vidDisplay.x = 0;
                    vidDisplay.width = 440;
                    vidDisplay.height = 330;
          }
          }

          1 person found this helpful
          • 2. Re: as3 to as2
            kglad Adobe Community Professional & MVP

             

             

            stage.scaleMode     = "noScale";
            stage.align          = "TL";
                 mcVideoControls.btnFullscreenOn.onRelease = fullscreenOnClicked;
                 mcVideoControls.btnFullscreenOff.onRelease = fullscreenOffClicked;
                
                 mcVideoControls.btnFullscreenOff._visible = false;


            function fullscreenOnClicked():Void {
                 stage.displayState = "fullScreen";
            }

            function fullscreenOffClicked():Void {
                 stage.displayState = "normal";
            }

             

            var fsLO:Object={};


            fsLO.onFullScreen=function():Void {
            if (stage.displayState=="fullScreen") {
            mcVideoControls.btnFullscreenOn._visible = false;
                      mcVideoControls.btnFullscreenOff._visible = true;

                      mcVideoControls._x = (Capabilities.screenResolutionX - 440) / 2;
                      mcVideoControls._y = (Capabilities.screenResolutionY - 33);

                      vidDisplay._height = (Capabilities.screenResolutionY - 33);
                      vidDisplay._width = vidDisplay._height * 4 / 3;
                      vidDisplay._x     = (Capabilities.screenResolutionX - vidDisplay._width) / 2;
            } else{

            mcVideoControls.btnFullscreenOn._visible = true;
                      mcVideoControls.btnFullscreenOff._visible = false;
                      mcVideoControls._x = 0;
                      mcVideoControls._y = 330;
                      vidDisplay._y = 0;
                      vidDisplay._x = 0;
                      vidDisplay._width = 440;
                      vidDisplay._height = 330;
            }
            }

            stage.addListener(fsLO);