flex, change the button image when mouse over/out -
with following code, have implemented image change when mouse hover button. image name hardcoded, specified in style. how can make parameterized? want reuse small utility image name input parameter. image used(14 images in case) included in flex project. using flex 3
<mx:style> .mycustombutton { upskin: embed(source="jjyxfx.png"); overskin:embed(source="cwgl.png"); downskin: embed(source="cwgl.png"); } </mx:style> <mx:button y="0" width="105" height="107" fillalphas="[1.0, 1.0, 1.0, 1.0]" x="0" fillcolors="[#3aa2d9, #3aa2d9]" stylename="mycustombutton" usehandcursor="true" buttonmode="true"/>
i don't believe can't parameterize css styles; you'll have set styles via actionscript:
public function setstylesonbutton(upskinvalue:string,overskinvalue:string,downskinstyle:string):void{ mybutton.setstyle('upskin',upskinvalue); mybutton.setstyle('overskin',overskinvalue); mybutton.setstyle('downskin',downskinstyle); }
make sure button has id can access in actionscript:
<mx:button id="mybutton" y="0" width="105" height="107" fillalphas="[1.0, 1.0, 1.0, 1.0]" x="0" fillcolors="[#3aa2d9, #3aa2d9]" stylename="mycustombutton" usehandcursor="true" buttonmode="true"/>
Comments
Post a Comment