Hello,

I scripted 3 sliders which should affect the tint color from my object. It somehow works but i dont get the effect i want, cause i made an r, g and b slider. But in stead of giving it a red tint when sliding the red slider it just randomly changes colors like from yellow to purple and black to rad again with the red slider :S probably doing something wrong (im just a n00b in as3, als my code is not very efficient i think anyway) but anyone having any ideas?

the function for color tint:


Actionscript Code:
function tintColor(object2:MovieClip, colorNum:Number, alphaSet:Number):void {
    var cTint:Color = new Color();
    cTint.setTint(colorNum, alphaSet);
    object2.transform.colorTransform = cTint;
}
Even if i change the
Actionscript Code:
cTint.setTint(colorNum, alphaSet);
to
Actionscript Code:
cTint.setTint(0x990011, alphaSet);
for example it gives the same result as when i make the same number with my sliders so i think something wrong there.

I made 3 sliders from 99 pixels, when i slide them they get a number from 0-99, then displayed below i made a calculation where it takes the numbers from the sliders and puts them together in 1 number. Like when u slide the R slider it will take the number 99 * 10000, makes it 990000. and then when i use the G slider to 40 it multiplys by 100 (4400) and adds it to 990000 making it 994400. I just made this up myself maybe there a better way but still then this part works, but the rest doesnt.


Actionscript Code:
//this code is in my enterframe event
var colorR = slidernumberR * 10000;
var colorG = slidernumberG * 100 + colorR;
var colorB = colorG + slidernumberB;
tintColor(object2, colorB, 100);]