2010-10-25 51 views
0

的背景图片我已经指派我的软件HBox中的logo图片如下 -更改HBox中

<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"> 

现在我需要和backgroundImage更改为其他图像上的事件。 如何做到这一点?我无法使用id'logoBox'来引用backgroundImage属性。

回答

1

BackgroundImage是HBox的一种风格。组件创建后,您需要像这样设置样式:

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