ForumsProgramming Forumchanging colour of a object in as3 how

4 4058
alex57834
offline
alex57834
88 posts
Nomad

I have been trying for a long time now to change the colour of a object exclusively with action script instead of going to the timeline and making two different colours of it.
Also it is inside of a if statement

  • 4 Replies
Matyi61
offline
Matyi61
1 posts
Nomad

[url=http://www.republicofcode.com/tutorials/flash/as3colortransform/]

alex57834
offline
alex57834
88 posts
Nomad

thanks for the link but I[b] just don't understand how to place it inside of a if statement

BlueJayy
offline
BlueJayy
27 posts
Nomad

if (<whatever you need in here&gt {
var my_color:ColorTransform = new ColorTransform();
my_color.blueOffset = <number>;
my_color.greenOffset = <number>;
my_color.redOffset = <number>;
my_square.transform.colorTransform = my_color;
}

Just insert the RGB color code of the color you want to change the object to for the 3 values inside the if statement.

alex57834
offline
alex57834
88 posts
Nomad

Thanks[b]

Showing 1-4 of 4