1 Reply Latest reply on Jul 2, 2006 8:36 AM by Newsgroup_User

    same movieclip in consecutive frames

    Level 7
      I have an empty movieclip with this code attached to it.

      class com.mcTakePicture extends MovieClip{


      //*****************************
      // public functions
      //*****************************
      public function mcTakePicture() {
      init();
      }
      //*****************************
      // end


      //*****************************
      // getters and setters
      //*****************************
      //*****************************
      // end


      //*****************************
      // private functions
      //*****************************
      private function init():Void {
      trace("init");
      }
      //*****************************
      // end

      }


      The movieclip is placed in the first 3 frames of the timeline. Each in its
      own keyframe. Basically when I run it I want it to output 'init' 3 times.
      However it only does it once. If I take out the second movieclip it outputs
      'init' twice like expected. Shouldn't init be called each time for each
      movieclip? It seems that Flash is determining that since they are the same
      to only runs once. I don't want to call an onEnterFrame function. Any ideas
      on how to get around this. I'm outputting the file as Flash 6.

      TIA
      Jeff


        • 1. Re: same movieclip in consecutive frames
          Level 7
          I tested this out using Flash 8 publishing as Flash player 6 and AS 2.0.

          The empty MovieClip is placed on stage with different instance names and
          will generate an init message for each when you test movie.



          --
          Lon Hosford
          www.lonhosford.com
          Flash, Actionscript and Flash Media Server examples:
          http://flashexamples.hosfordusa.com
          May many happy bits flow your way!
          "Jeff Schumann" <jschumann@imedstudios.com> wrote in message
          news:e7u93p$fjk$1@forums.macromedia.com...
          >I have an empty movieclip with this code attached to it.
          >
          > class com.mcTakePicture extends MovieClip{
          >
          >
          > //*****************************
          > // public functions
          > //*****************************
          > public function mcTakePicture() {
          > init();
          > }
          > //*****************************
          > // end
          >
          >
          > //*****************************
          > // getters and setters
          > //*****************************
          > //*****************************
          > // end
          >
          >
          > //*****************************
          > // private functions
          > //*****************************
          > private function init():Void {
          > trace("init");
          > }
          > //*****************************
          > // end
          >
          > }
          >
          >
          > The movieclip is placed in the first 3 frames of the timeline. Each in its
          > own keyframe. Basically when I run it I want it to output 'init' 3 times.
          > However it only does it once. If I take out the second movieclip it
          > outputs 'init' twice like expected. Shouldn't init be called each time for
          > each movieclip? It seems that Flash is determining that since they are the
          > same to only runs once. I don't want to call an onEnterFrame function. Any
          > ideas on how to get around this. I'm outputting the file as Flash 6.
          >
          > TIA
          > Jeff
          >