views:

225

answers:

2

I want to check the RGB color of the object using actionscript in flash. The name of the object is object1. I checked like this but it didnt worked. help me

if (object1.color=rgb(255,0,255))
{
  trace("Selected Pink");
}

Give me correct syntax to check the rgb color of the object

+2  A: 

I think the comparison operator in Actionscript needs to "=" signs.

if (object1.color == rgb(255,0,255))
weichsel
still its not working
Rajasekar
A: 

how are you setting our objects color property? Is Color a String value? or a Number ex: 0xFF00FF.

Is rgb() a function that you created? or just pseudo code? How do you want this comparison to work?