3 Replies Latest reply on Jun 14, 2011 7:52 AM by Ned Murphy

    How Can I convert AS3 in AS2?

    Diamondamey

      Hi,

       

      I have following script in AS3 & I want it in AS2... is it possible?

      Pls help.....

       

       

      package
      {
          import flash.events.Event;
          import flash.events.MouseEvent;
          import flash.display.MovieClip;
         
          import gs.TweenLite;

       

          public class Accordion extends MovieClip
          {       
                     
              var speed:Number = 1;
             
              public function Accordion()
              {
                  tour_mc.addEventListener(MouseEvent.MOUSE_OVER, overHandler, false, 0, true);   
                  front_mc.addEventListener(MouseEvent.MOUSE_OVER, overHandler, false, 0, true);
                  resta_mc.addEventListener(MouseEvent.MOUSE_OVER, overHandler, false, 0, true);
                  inv_mc.addEventListener(MouseEvent.MOUSE_OVER, overHandler, false, 0, true);           
                  wd_mc.addEventListener(MouseEvent.MOUSE_OVER, overHandler, false, 0, true);
                  fd_mc.addEventListener(MouseEvent.MOUSE_OVER, overHandler, false, 0, true);
              }
             
              protected function overHandler(event:MouseEvent):void
              {
                  if(event.target == tour_mc)
                  {
                      TweenLite.to(tour_mc, speed, { x:0, y:0 } );
                      TweenLite.to(front_mc, speed, { x:610, y:0 } );
                      TweenLite.to(resta_mc, speed, { x:640, y:0 } );
                      TweenLite.to(inv_mc, speed, { x:670, y:0 } );
                      TweenLite.to(wd_mc, speed, { x:700, y:0 } );
                      TweenLite.to(fd_mc, speed, { x:730, y:0 } );
                     
                  }
                  else if(event.target == front_mc)
                  {
                      TweenLite.to(tour_mc, speed, { x:0, y:0 } );
                      TweenLite.to(front_mc, speed, { x:30, y:0 } );
                      TweenLite.to(resta_mc, speed, { x:640, y:0 } );
                      TweenLite.to(inv_mc, speed, { x:670, y:0 } );
                      TweenLite.to(wd_mc, speed, { x:700, y:0 } );
                      TweenLite.to(fd_mc, speed, { x:730, y:0 } );
                  }
                  else if(event.target == resta_mc)
                  {
                      TweenLite.to(tour_mc, speed, { x:0, y:0 } );
                      TweenLite.to(front_mc, speed, { x:30, y:0 } );
                      TweenLite.to(resta_mc, speed, { x:60, y:0 } );
                      TweenLite.to(inv_mc, speed, { x:670, y:0 } );
                      TweenLite.to(wd_mc, speed, { x:700, y:0 } );
                      TweenLite.to(fd_mc, speed, { x:730, y:0 } );
                  }
                  else if(event.target == inv_mc)
                  {
                      TweenLite.to(tour_mc, speed, { x:0, y:0 } );
                      TweenLite.to(front_mc, speed, { x:30, y:0 } );
                      TweenLite.to(resta_mc, speed, { x:60, y:0 } );
                      TweenLite.to(inv_mc, speed, { x:90, y:0 } );
                      TweenLite.to(wd_mc, speed, { x:700, y:0 } );
                      TweenLite.to(fd_mc, speed, { x:730, y:0 } );
                  }
                  else if(event.target == wd_mc)
                  {
                      TweenLite.to(tour_mc, speed, { x:0, y:0 } );
                      TweenLite.to(front_mc, speed, { x:30, y:0 } );
                      TweenLite.to(resta_mc, speed, { x:60, y:0 } );
                      TweenLite.to(inv_mc, speed, { x:90, y:0 } );
                      TweenLite.to(wd_mc, speed, { x:120, y:0 } );
                      TweenLite.to(fd_mc, speed, { x:730, y:0 } );
                  }
                  else if(event.target == fd_mc)
                  {
                      TweenLite.to(tour_mc, speed, { x:0, y:0 } );
                      TweenLite.to(front_mc, speed, { x:30, y:0 } );
                      TweenLite.to(resta_mc, speed, { x:60, y:0 } );
                      TweenLite.to(inv_mc, speed, { x:90, y:0 } );
                      TweenLite.to(wd_mc, speed, { x:120, y:0 } );
                      TweenLite.to(fd_mc, speed, { x:150, y:0 } );
                  }
              }
          }
      }

       

       

       

      Thanks in advance