Forums

ForumsProgramming Forum

changing colour of a object in as3 how

Posted Jan 15, '12 at 6:09am

alex57834

alex57834

89 posts

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

 

Posted Jan 15, '12 at 4:56pm

Matyi61

Matyi61

1 post

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

 

Posted Jan 16, '12 at 1:02pm

alex57834

alex57834

89 posts

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

 

Posted Jan 16, '12 at 1:07pm

BlueJayy

BlueJayy

27 posts

if () {
   var my_color:ColorTransform = new ColorTransform();
   my_color.blueOffset = ;
   my_color.greenOffset = ;
   my_color.redOffset = ;
   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.

 

Posted Jan 17, '12 at 11:27am

alex57834

alex57834

89 posts

Thanks[b]

 
Reply to changing colour of a object in as3 how

You must be logged in to post a reply!