Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-29-2003, 08:55 PM   #1
vancryce
Registered User
 
Join Date: Jun 2003
Posts: 3
Unhappy modify tint property with actionscript?

Hi everyone?

I need to know if it´s possible to change the TINT property of an object (movie, button) with actionscript:

I know how to change de ALPHA property like this example:

on(release){
_root.<object>._alpha=40;
}

and the COLOR, but i don´t know the code for the TINT property.

Thanks,

vancryce
vancryce is offline   Reply With Quote
Old 06-29-2003, 09:10 PM   #2
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

tint would be done through color.

see the examples at

http://proto.layer51.com/l.aspx?p=10
__________________
(6)
senocular is offline   Reply With Quote
Old 06-29-2003, 09:28 PM   #3
vancryce
Registered User
 
Join Date: Jun 2003
Posts: 3
Default

First of all, thanks for your speed to answer my question:


I found this in that site:

Color.prototype.setTint = function (r, g, b, amount) {
var trans = new Object();
trans.ra = trans.ga = trans.ba = 100 - amount;
var ratio = amount / 100;
trans.rb = r * ratio;
trans.gb = g * ratio;
trans.bb = b * ratio;
this.setTransform(trans);

Ok, but how i use it?
vancryce is offline   Reply With Quote
Old 06-29-2003, 09:44 PM   #4
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

put that code in the first frame of the movie so its run and defined for flash as soon as the movie starts. Then you can use it with a color object just like you would setRGB or setTransform


myColor = new Color(myClip);
//set myClip's tint to be 50% red
myColor.setTint(255,0,0, 50);
__________________
(6)
senocular is offline   Reply With Quote
Old 06-29-2003, 09:57 PM   #5
vancryce
Registered User
 
Join Date: Jun 2003
Posts: 3
Default

What can i say!! It works!!
This was my first attempt to get an answer from a Forum, and it works!!
At least someone try!!

Thank you senocular!!

You can see the result of your help later in this homepage:

http://orbitalsolutions.no.sapo.pt

Last edited by vancryce; 06-29-2003 at 10:00 PM.
vancryce is offline   Reply With Quote
Old 07-04-2004, 12:08 AM   #6
gonecat
Registered User
 
Join Date: Jan 2004
Location: Los Angeles
Posts: 18
Thumbs up adding a delay between color fades

hi guys,
i've implemented the above and it works great, thanks a lot. i'm wondering how i can add a 'tween' delay from one color to the other of say, 1 second.
any ideas would be greatly appreciated,
-gonecat
gonecat is offline   Reply With Quote
Old 07-06-2004, 04:08 PM   #7
gonecat
Registered User
 
Join Date: Jan 2004
Location: Los Angeles
Posts: 18
Default

pleeeeez ?
gonecat is offline   Reply With Quote
Old 05-20-2005, 01:11 AM   #8
andehlu
this modern love
 
andehlu's Avatar
 
Join Date: Aug 2004
Location: torontoCANADA
Posts: 429
Default

wow, this works AMAZING!!! thanks again secocular
andehlu is offline   Reply With Quote
Old 07-18-2006, 05:20 AM   #9
audiowizard
Registered User
 
Join Date: Apr 2006
Posts: 102
Default using within .as class

How would you use this in a public function, so that the tint is released when another movieclip linked to the class is selected and therefor tinted?
audiowizard is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:38 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.