开发者

Changing the background image of HBox

I have assigned a logo image of my software to HBox as follows -

<mx:HBox id="logoBox" width="98%" textAlign="left" backgroundSize="100%" horizontalAlign="left" height="18%" backgroundImage="images/img_header_new_3-bg.jpg" verticalAlign="bottom" backgroundColor="#1573A4">

Now I need to change the backgroundImage to some other image on a event. How to achieve 开发者_C百科this? I am not able to refer backgroundImage property using the id 'logoBox'


BackgroundImage is a style of HBox. After the component has been created you need to set the style like so:

logoBox.setStyle("backgroundImage","images/img_header_new_2-bg.jpg");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜