Rajasekar
Rajasekar

Reputation: 18948

How to check the rgb color of the object using if condition? help me

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

Upvotes: 0

Views: 681

Answers (2)

Johnny_Generic
Johnny_Generic

Reputation:

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?

Upvotes: 0

Thomas Zoechling
Thomas Zoechling

Reputation: 34253

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

if (object1.color == rgb(255,0,255))

Upvotes: 2

Related Questions