flex - flex4 change custom btn icon -
i followed post here custom iconbutton using flex4 link text however, want change icon of buttom @ run time, create in actionscript :
[bindable] [@embed('assets/1.png')] public var pic1:class; [bindable] [@embed('assets/2.png')] public var pic2:class; public function clicktochange() {custombtn1.setstyle("icon", pic2);}
and .mxml
<local:custombtn id="custombtn1" icon='{pic1}' width="80" height="80" click=clicktochange();/>
but can't custombtn change pic1 pic2 when click it. hint part did wrong? thanks.
simply:
custombtn1.icon = pic2;
Comments
Post a Comment