2 Replies Latest reply on Dec 11, 2006 4:58 PM by Newsgroup_User

    Change the color to an swf file

    Level 7
      Hello:
      I have an swf file with a menu (with four options) imported to a castmember
      in Director.
      I would like to change the color of the selected option (text).
      How can I do that please?
      thank you very much


        • 1. Re: Change the color to an swf file
          duckets Level 1
          Dave Mennenoh gave this answer to a very similar question recently:

          quote:

          Originally posted by: Dave Mennenoh
          If you want to modify the color of a MovieClip within your Flash cast
          member, probably the easiest way is to code a color function within Flash
          and then just call that from Director.

          So, in your Flash movie you would add a function ('newColor' attached below)

          And in Director you can now color any clip by calling newColor:

          sprite(3).newColor("aSquare", "0xFF0000")

          which would color the MovieClip 'aSquare' solid red.
          quote:


          • 2. Re: Change the color to an swf file
            Level 7
            Thank you very much:
            The really need that I have is that I have made a menu button with four text
            (one for each option in the menu) and I would like to change the color and
            stay when the user click on that option (in a swf file)
            Can you tell me how to do that, please?
            thank you in advance.




            "duckets" <webforumsuser@macromedia.com> escribió en el mensaje
            news:el6j5p$mul$1@forums.macromedia.com...
            > Dave Mennenoh gave this answer to a very similar question recently:
            >
            >
            quote:

            Originally posted by: Dave Mennenoh
            > If you want to modify the color of a MovieClip within your Flash cast
            > member, probably the easiest way is to code a color function within Flash
            > and then just call that from Director.
            >
            > So, in your Flash movie you would add a function ('newColor' attached
            > below)
            >
            > And in Director you can now color any clip by calling newColor:
            >
            > sprite(3).newColor("aSquare", "0xFF0000")
            >
            > which would color the MovieClip 'aSquare' solid red.
            >
            quote:


            >
            >
            > ---------In your Flash Movie:------------------
            >
            > import flash.geom.ColorTransform;
            > import flash.geom.Transform;
            >
            > function newColor(whichClip, newCol){
            > var ct:ColorTransform = new ColorTransform();
            > ct.rgb = newCol;
            > var tr:Transform = new Transform(this[whichClip]);
            > tr.colorTransform = ct;
            > }
            >
            >
            >
            > ------------In Director:----------------------
            >
            > sprite(3).newColor("aSquare", "0xFF0000")
            >