views:

32

answers:

1

Hi,

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'

+1  A: 

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