4 Replies Latest reply on Jan 30, 2010 10:23 AM by waterdad568

    MC Problem

    beno12345

      Hi;

      I have this code:
      package
      {
         import flash.events.Event;
         import flash.events.ProgressEvent;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.display.MovieClip;
         import com.greensock.*;
         import com.greensock.easing.*;
         public class Main2 extends MovieClip
         {
            //Import Library Assests
                      public var myThumb:CloseThumb;
           
            public function Main2()
            {
               init();
              
            }
           
            public function init():void
            {
                              theThumb();
      }
                      public function theThumb():void
                      {
                              myThumb = new CloseThumb();
                              myThumb.x = 365;
                              myThumb.y = 355;
      myThumb.addEventListener(Event.ENTER_FRAME, checkFrame);
                      }
      public function checkFrame(e:Event):void {
      if (e.target.currentFrame == 1) {
      e.target.removeEventListener(Event.ENTER_FRAME, checkFrame);
      trace('check');
      addChild(myThumb);
      TweenMax.to(myThumb, .4, {shortRotation:{rotation:60}, ease:Back.easeOut});
      }
      }
         }
      }
      It works fine. The problem is that if I change currentFrame from == 1 to any other value, it breaks. The reason apparently is because the mc in the fla is only 1 frame long. Now, I need to be able to call it from various frames. Please advise.
      TIA,
      beno