Since you're implementing IGraphicRenderer you can set that logic in the graphic setter.public function set graphic(value:Graphic):void{}When dealing with states in a SkinnableComponent you may need to override the following functions.
override public function initialize():void
{
super.initialize();
states.push(new State({name:"state1"}));
states.push(new State({name:"state2"}));
currentState = "state1";
}
override protected function getCurrentSkinState():String
{
return currentState;
}
override protected function stateChanged(oldState:String, newState:String, recursive:Boolean):void
{
super.stateChanged(oldState, newState, recursive);
invalidateSkinState();
}
Then in the graphic setter, change the state based on the attribute data.