4 Replies Latest reply on Aug 29, 2011 11:21 AM by im_just_here

    controlling a movieclip loaded from a swc

    im_just_here Level 1

      I'm loading assets from a swc and I need to loop through every frame of the movieclip and find a certain instance so I can colorize it. Is this possible? It seems that with a swc I loose the ability to control the movieclips playback. It just plays and repeats no matter what I do.

        • 1. Re: controlling a movieclip loaded from a swc
          kglad Adobe Community Professional & MVP

          what's the swc do?  as2 or as3?  what properties are exposed by the swc?

          • 2. Re: controlling a movieclip loaded from a swc
            im_just_here Level 1

            AS3. The swc contains my character animations (walk, run, jump, etc). I need to go through every frame of each animation and change the characters skin color.

             

            Right now I'm doing it with an enter_frame. So it's constantly updating the skin color durring the whole game. It works but I thought it would be better to set the skin color on the Movieclips when they are loaded and then I wouldn't have to do it continuously. But since I'm loading the movieclips from a swc I can't seem to control them with gotoAndStop. For example I'd like to do the following for each movieClip:

             

            for(var i:int=0; i< movieClip.totalFrames; i++){

                 movieClip.gotoAndStop(i);

                 TweenMax.to(movieClip.Head, 0, { colorMatrixFilter: { colorize:bodyColor, amount:1 }} );

            }

             

            Then when I set my animation states the movieClips would already have their skin colors set. Is there a way to do this using classes from a swc? This is my first time using FlashDevelop and the tutorials only show using swcs. Is there a better way to do this?

            • 3. Re: controlling a movieclip loaded from a swc
              kglad Adobe Community Professional & MVP

              in the first frame of your character movieclip, use a variable that determines your character's skin color and publish a new swc.

              • 4. Re: controlling a movieclip loaded from a swc
                im_just_here Level 1

                I thought a swc removed the actionsript from all movieclips inside it. For example, if I put a stop() inside my animation when it's played from the swc it does not stop.