1 Reply Latest reply on Jun 22, 2007 3:24 AM by Rex_Chan

    not work with addEventListener

    Rex_Chan
      I am using mDisplayObject.addEventListener(Event.ENTER_FRAME, doingTween); to run a doingTween function. However it cause error ArgumentError: Error #1063: Argument count mismatch on LabelClip/LabelClip::doingTween(). Expected 0, got 1. Please help me fix it / suggestion to improve it.

      package
      {
      import flash.display.*;
      import flash.events.*;

      public class LabelClip
      {
      private var mDisplayObject:DisplayObject = null;
      private var mTimeline:MovieClip = null;

      public function LabelClip(pDisplayObject:DisplayObject,pLabel:Array)
      {
      mDisplayObject = pDisplayObject;
      mTimeline = MovieClip(mDisplayObject);
      }

      public function stopPlay():void
      {
      mDisplayObject.removeEventListener(Event.ENTER_FRAME, doingTween);
      }

      public function startPlay():void
      {
      stopPlay();
      mDisplayObject.addEventListener(Event.ENTER_FRAME, doingTween);
      }

      private function doingTween():void
      {
      mTimeline.nextFrame();
      }
      }
      }