开发者

Changing the background image of HBox

开发者 https://www.devze.com 2023-01-21 16:06 出处:网络
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%\" backgroun

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

精彩评论

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

关注公众号