A quick question,
We can set <s:soildColor color= "0x000000" color.select="0xcc0000" color.out="0x0000cc"> in MXML to attach soildColor with diffenrent states. As an actionscript learner, I want to know how can we achieve the same goal in pure actionscript? I searched internet for hours and could not figure it out. Please give a hand.
Thanks in advance for any help.
You can probably listen to the "ENTER_STATE" and "EXIT_STATE" events in the container that is changing the state and change the colors accordingly.
var s:SolidColor = new SolidColor(0x000000);
private function onStateChange(event:FlexEvent):void
if((event.target as UIComponent).currentState == "select")
s.color = 0xcc0000;
I haven't tested the code, but I think this should work.
Thanks Pramod for the help,
Solution works perfect. I do not know why the enter state event did not get fired as event listener did not get registered on. But after changing to StateChangeEvent.CURRENT_STATE_CHANGE, code works fine.