A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: setRGB

  1. #1
    Member
    Join Date
    Sep 2000
    Posts
    70

    setRGB

    Hi there

    Ive got a moviclip in the Library = Myfill

    How can set the color in main timeline 1. frame with AS3

    Regards
    flemming

  2. #2
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    DisplayObject.transform.ColorTransform;

    Look this up in the ActionScript documentation.
    Remember that you may not apply changes to a transform object.
    You must first create a new one (or copy the original one), apply changes to that, and then apply the transform object to your target object.
    Altruism does not exist. Sustainability must be made profitable.

  3. #3
    Member
    Join Date
    Sep 2000
    Posts
    70
    thanks yeah


    import flash.geom.ColorTransform;

    var color_transf:ColorTransform = mc.transform.colorTransform;
    color_transf.color = 0xff0000;
    Btn_fill.transform.colorTransform = color_transf;


    BUT how can I change colors of more Moveclips in my Library

    You see my clips are placed around in many other clips - So is there a way to change the color Global without thinking of wich movieclip its inside


    Eg: _root.scroll.arrow.Btn_fill


    :-)

  4. #4
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    Well I don't know of any built-in feature for that.
    But you could design a class for that, a controller.
    Basically you could register your movieclips with such controller (which would store pointers in an array), so you just call a method on the controller and leave the task of setting the color for all registered movieclips to it.

    Or the opposite way around, you could use the controller to dispatch a "colorChange" event throughout the whole movie, and register an event handler within each movieclip which will take care of changing the color for it's referring movieclip whenever the event is dispatched.
    Altruism does not exist. Sustainability must be made profitable.

  5. #5
    Senior Member
    Join Date
    Jan 2008
    Posts
    150
    Well if you don't need to give them unique color changes can't you just apply the change to the thing that contains them all?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center