Vishal
Vishal

Reputation: 2752

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 this? I am not able to refer backgroundImage property using the id 'logoBox'

Upvotes: 0

Views: 2793

Answers (1)

dlew
dlew

Reputation: 106

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

Upvotes: 1

Related Questions