2 Replies Latest reply on Jan 21, 2010 12:14 PM by Seraph00

    Resizing image problem

    Seraph00

      So I have a movie clip moving across the screen based on the root of the x mouse with as3.  I'm having trouble trying to resize an image using the Mouse over command.  With the code below the image is only resizing on the left side of the screen.  Can anyone tell me why its only working on the left side?

       

      Here's a link to the swf online:

       

      http://www.definingmomentstudios.com/portfolio.html


      Here's the code:

       

      stop();

       

      MovieClip(root).addEventListener(Event.ENTER_FRAME, enterFrameHandler);

       

      function enterFrameHandler(event:Event):void

       

      {
          var myVar:Boolean = false;
         
          if(MovieClip(root).mouseX < 318 || MovieClip(root).mouseX >850){
              myVar=true;
          }
          if(MovieClip(root).mouseX > 319 && MovieClip(root).mouseX < 851){
                  myVar=false;
          }
          if(MovieClip(root).mouseX < 318 && myVar==true){
              imgBar.prevFrame();
              bkgBar.prevFrame();
              }
          if(MovieClip(root).mouseX < 318 && myVar==true){
              imgBar.prevFrame();
              bkgBar.prevFrame();
              }
         
          if(MovieClip(root).mouseX > 850 && myVar==true){
              imgBar.nextFrame();
              bkgBar.nextFrame();
              }
          if(MovieClip(root).mouseX > 950 && myVar==true){
              imgBar.nextFrame();
              imgBar.nextFrame();
              bkgBar.nextFrame();
              bkgBar.nextFrame();
              }
          if(MovieClip(root).mouseX > 1100 && myVar==true){
              imgBar.nextFrame();
              imgBar.nextFrame();
              imgBar.nextFrame();
              bkgBar.nextFrame();
              bkgBar.nextFrame();
              bkgBar.nextFrame();
              }
              if(MovieClip(root).mouseX > 1300 && myVar==true){
              imgBar.nextFrame();
              imgBar.nextFrame();
              imgBar.nextFrame();
              imgBar.nextFrame();
              bkgBar.nextFrame();
              bkgBar.nextFrame();
              bkgBar.nextFrame();
              bkgBar.nextFrame();
              }
          if(myVar==false){
              imgBar.stop();
              bkgBar.stop();
          }
      }

       

      imgBar.imgBarInside.port1_btn.addEventListener(MouseEvent.MOUSE_OVER, resizeBtn);

       


      function resizeBtn(event:MouseEvent):void {
      imgBar.imgBarInside.port1_btn.width =  imgBar.imgBarInside.port1_btn.width * 1.3;
      imgBar.imgBarInside.port1_btn.height =  imgBar.imgBarInside.port1_btn.height * 1.3;
      }

       

      imgBar.imgBarInside2.port1_btn.addEventListener(MouseEvent.MOUSE_OVER, resizeBtn2);

       


      function resizeBtn2(event:MouseEvent):void {
      imgBar.imgBarInside2.port1_btn.width =  imgBar.imgBarInside2.port1_btn.width * 1.3;
      imgBar.imgBarInside2.port1_btn.height =  imgBar.imgBarInside2.port1_btn.height * 1.3;
      }

       

       

      Thanks for the help