I try to change the backgroundImage of a canvas
?????private function butClickHandler(event:MouseEvent):void
?????{
??????????????????? /* invalidly */
??????????styleCanvas.setStyl e(backgroundImage, @Embed('bird.png'));
????????????? //? styleCanvas.setStyle(backgroundImage, Embed('bird.png'));
????????????? //? styleCanvas.setStyle(background-Image, @Embed('bird.png'));
?????????????? //? styleCanvas.setStyle(background-Image,
@Embed(source='bird.png'));
??????????????????? /* normally */
??????????styleCanvas.setStyl e(backgroundColor, #777777);
??????????Button(event.target ).setStyle(fontSize, 22);
?????}
??????? <mx:Button x="38" y="44" label="为中国喝彩" click="butClickHandler(event)"/>
?????<mx:Canvas id="styleCanvas" width="80" height="80">
??????????<mx:Label text="I'm Label"/>
?????</mx:Canvas>
在2009-07-09,"niamath basha" <[email protected]> 写道:
small mistake
use fontSize
styleLabel.setStyle("fontSize", 72);
With Regards,
Niamath Basha
www.niamathbasha.wordpress.com
2009/7/8 j2me_soul <[email protected]>
I try to change the style at runtime
<mx:Button x="38" y="44" label="为中国喝彩" click="butClickHandler(event)"/>
<mx:Label id="styleLabel" text="I'm Label"/>
private function butClickHandler(event:MouseEvent):void
{
/* it doesn't work */
styleLabel.setStyle("font-size", 72);
}
200万种商品,最低价格,疯狂诱惑你