12/6/2009 11:26:15 PM
Title:
appication bg
hi i have done swf loader with xml data loaded dynamically... i want to do background image of application also changed as same xml data which is loaded in to swf loader.... can i set bg image for application regarding the changes of the swf data's?
12/7/2009 1:47:09 AM
you can set the application background by using the property
backgroundImage="" backgroundColor=""
to set that dynamically use setStyle property
Application.application.setStyle("backgroundImage", "background.jpg");
12/7/2009 2:18:28 AM
no no i mean it can i change the application background image while changing the swf source? that mean swf source set as a application background image.. if its flower means application bg Image also flower...and if its animal means its also set as a animal can i do it?
12/7/2009 3:40:49 AM
yes you can do that, add complete handler to swf loader component so that when you load a swf like flower it fires complete handler which loads swf file in application background:
<mx:SWFLoader x="112" y="113" source="flower.swf" complete="setBackgroundSWF('flower.swf')"/>
//call this function and pass swf source to load as background of your application
private function setBackgroundSWF(swfSource:String):void{
Application.application.setStyle("backgroundImage",swfSource);
}
12/7/2009 5:26:47 AM
ya, i done it...thanks...