A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: Looking on how to tint an mc thru AC -- help please!

  1. #1
    Illuminatus! fospher.com's Avatar
    Join Date
    Jan 2002
    Location
    5th Dimension
    Posts
    2,185

    Looking on how to tint an mc thru AC -- help please!

    i want to stimulate the white blink effect when the hero is hit - but i dont want to create another frame in the hero mc - itll be an argument to the other variables.

    so my question is: how would i tint an mc white thru ac?
    set color transform...something like that, please give me a hint guys!

  2. #2
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601
    it's something like:

    Code:
    new_coloration = new color(_root.player);
    color_change = {ra:'-100', rb:'255', ga:'-100', gb:'255', ba:'-100', bb:'255', aa:'100', ab:'100'};
    new_coloration.setTransform(color_change);
    if you are lost, i can explain more ^^

    i'm not sure, but i applied it in my fighting game open source, used to change some settings of the shadow.

  3. #3
    PWFilms
    Guest
    wow, thanks for that bit of code! I just added a Disco cheat to my game because of this... Yee!

  4. #4
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601
    really? ^^

    you can also play with random values, and play it on an enterFrame event. that's surely super disco tonight!

  5. #5
    PWFilms
    Guest
    yup! Thats what i did! Heh.

  6. #6
    Illuminatus! fospher.com's Avatar
    Join Date
    Jan 2002
    Location
    5th Dimension
    Posts
    2,185
    _root.bigCir = new Color(_root.cirBig);
    bigCir.setRGB(0xff6666);

    www.fospher.com/color.swf [press the small black circle]
    www.fospher.com/color.fla

    hmmm is that the f4 method? i found another one marmotte, and made a little fla out of it...

    well that worked for a little independent swf - but didnt work for my game oh well thanks for the help 'motte.

  7. #7
    Illuminatus! fospher.com's Avatar
    Join Date
    Jan 2002
    Location
    5th Dimension
    Posts
    2,185
    hmmm apparently my method only works thru a button - well onto your code marmotte

    could you explain that code btw?? i dont see where the rgb would go at all...just a bunch of numbers to me

  8. #8
    Illuminatus! fospher.com's Avatar
    Join Date
    Jan 2002
    Location
    5th Dimension
    Posts
    2,185
    holy cow!!!!!!!!!!! that code turned my guy negative, not white!! amazing!!!!! gee thanks a million marmotte, i didnt know that was even possible!

    oh and how would i reset?
    Last edited by fospher.com; 02-23-2003 at 01:59 AM.

  9. #9
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601
    hey fospher:

    negative, mmmh? ^^
    i used that effect in my kid icarus conversion, when you was hit by an enemy; your colors was flashing during a short period of time...

    to reset the values, just put them at 0 again:
    color_change = {ra:'0', rb:'0', ga:'0', gb:'0', ba:'0', bb:'0', aa:'0', ab:'0'};

    > what these values mean:
    well, when you try to change them manually via flash:
    click your MC once, then choose "color" in the floating window below (where you can choose for example the alpha property of the MC). choose "advanced", and then you have another window with 8 values. these are the ones...

  10. #10
    Junior Member
    Join Date
    May 2002
    Posts
    0
    Originally posted by fospher.com
    holy cow!!!!!!!!!!! that code turned my guy negative, not white!! amazing!!!!! gee thanks a million marmotte, i didnt know that was even possible!

    oh and how would i reset?
    what numbers did you use?!?!?! id really like to know!!!

  11. #11
    Junior Member
    Join Date
    May 2002
    Posts
    0
    nevermind i guess the numbers were the ones marmotte used!

  12. #12
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    If it's any help www.robertpenner.com has a load of colour prototypes on there ( Tint, brightness etc. ), I use them in just about everything !

    Squize.

  13. #13
    Illuminatus! fospher.com's Avatar
    Join Date
    Jan 2002
    Location
    5th Dimension
    Posts
    2,185
    @'motte: the graphic i was using was a GIF though, i thought flash could only handle vector --- i guess they lied to us . mine really didnt flash, just reversed the colors - e.g. black turned to white, orange turned to blue, blue turned to pink...awwesome...and thanks for explaining the code.

    oh and the reset code u gave me seems to turn the guy transparent -- i guess ill play around with it some more

    @squize: of course, i forgot all about that site - i had it bookmarked but then i reformatted my comp - thanks for the link.
    Last edited by fospher.com; 02-24-2003 at 12:37 AM.

  14. #14
    Illuminatus! fospher.com's Avatar
    Join Date
    Jan 2002
    Location
    5th Dimension
    Posts
    2,185
    it appears the reset code is: {ra:'100', rb:'0', ga:'100', gb:'0', ba:'100', bb:'0', aa:'100', ab:'0'}

    if you reset everything to 0, it sets the alpha to 0, too, not to mention the RGB. for those of you who are just peeping at this thread, i found the info, so ill post the explanation of the code.

    ra is the percentage for the red component (-100 to 100).

    rb is the offset for the red component (-255 to 255).

    ga is the percentage for the green component (-100 to 100).

    gb is the offset for the green component (-255 to 255).

    ba is the percentage for the blue component (-100 to 100).

    bb is the offset for the blue component (-255 to 255).

    aa is the percentage for alpha (-100 to 100).

    ab is the offset for alpha (-255 to 255).

    thanks for all the help g's, you're the ****

  15. #15
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601
    oh and the reset code u gave me seems to turn the guy transparent
    baaaahyes ^^
    i just wrote the code too fast. of course if the alpha values are at 0, no more character visible.

  16. #16
    I'm dope. Psytrix's Avatar
    Join Date
    Aug 2002
    Location
    Slidell, LA
    Posts
    309
    bravo, very helpful thread. those codes are just fun to use.

    w00t!

  17. #17
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    [can we not private message someone on this board?]

    anyways.. psytrix, just noticed where you live. i lived in shreveport for about 6 years. i was stationed there. i just got back here to cali about 7 months ago (even tho i got out of the military in 2000, i stayed there with my ex-wife (not ex at the time), she's from keithville.

    just thot i'd say hey.

    -frank

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