A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: question about tint

  1. #1
    Senior Member
    Join Date
    Nov 2000
    Location
    Denmark
    Posts
    159

    Does anyone know if it is possible to control the brightness, or the tint of a MC, with AS. ??



  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    139
    Apparently not. But you might achieve something by covering the object(s) you want tinted with another symbol of identical shape which has a fixed colour: and you can then change the alpha values of this overlaid symbol to create a virtual tint. Make sense?
    [Edited by Andrew Staffell on 05-07-2001 at 10:30 PM]

  3. #3
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Hi...sure by using the Color(object)...the setTransform method to be specific....for example, putting this action on a button will tint your mc to orange-ish...just substitute the Instance Name of your movie clip for 'myMovieClip' to see how it works...

    Code:
    on (release) {
    	myColor = new Color(_root.myMovieClip);
    	myColorTransform = new Object();
    	myColorTransform = {ra:'100', rb:'217', ga:'100', gb:'0', ba:'100', bb:'-153', aa:'100', ab:'0'};
    	myColor.setTransform(myColorTransform);
    }
    To get a complete description of how it works check out Color.setTransform in the ActionScript Reference Guide...

    Hope this helps...

    -pigghost-
    [Edited by pigghost on 05-08-2001 at 12:09 AM]

  4. #4
    Senior Member
    Join Date
    Nov 2000
    Location
    Denmark
    Posts
    159
    thanx guys, I will give it a try.

  5. #5
    Senior Member
    Join Date
    Nov 2000
    Location
    Denmark
    Posts
    159
    -pigghost

    I used your idea about the color transform, but now I need the color set back to the original color.

    its, a game where when the hero gets hit, he "flashes", and when not hit he should look, normal. And thats where my problem lies.

  6. #6
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Hi...in the above code you just need to change this line to:

    myColorTransform = {ra:'100', rb:'0', ga:'100', gb:'0', ba:'100', bb:'0', aa:'100', ab:'0'};

    This sets all the percentages and offsets back to the default settings...these settings are derived from the Advanced Settings in the Effect Panel...

    To see all the things you can do, select a movieClip on the stage and go to Window>Panels>Effect...then in the dropdown pick Advanced...

    Play around with the settings and you'll see the effects in color and alpha...

    From this, you can decide what you'd like your settings to be in the code....

    Hope this makes sense...

    -pigghost-

  7. #7
    Senior Member
    Join Date
    Nov 2000
    Location
    Denmark
    Posts
    159
    it makes alot of sense, thanx again.

  8. #8
    Senior Member
    Join Date
    Nov 2000
    Location
    Denmark
    Posts
    159
    pigghost,

    Thanx for your advice, I used it in this:

    http://home1.stofanet.dk/henrike/spaceboy.htm

  9. #9
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Very Cool! But I stink at the game...I got killed every time!

    I'll have to come back and play it again when I have more time...

    Take care...

    -pigghost-

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