-1

I am working on AIR application. In which i Put refresh button to refresh the application. When User click on Refresh Button following code refresh my application.

protected function onRefreshClickHandler(event:MouseEvent):void
{
var app:WindowedApplication =
WindowedApplication(FlexGlobals.topLevelApplication);

var mgr:ProductManager =
new ProductManager("airappinstaller");

mgr.launch("-launch " +
                        app.nativeApplication.applicationID + " " +
                        app.nativeApplication.publisherID);

app.close();
}

Above code works nicely.
Now, Again When application start then skinclass of button and backgroundImage of borderConatiner is not working.

<s:Button click="onRefreshClickHandler(event)" 
                  buttonMode="true" skinClass="skins.ButtonRefresh"/>

And:

<s:BorderContainer width="100%" borderVisible="false" 
                       backgroundImage="@Embed('assets/images/back.png')">

I don't know why this weird things happen.

Is there any solution for that?
How can i get my skin back when i restart my application?

Thanks.

ketan
  • 19,129
  • 42
  • 60
  • 98

1 Answers1

0

Now, I got the solution for my question.
I solve it by giving skinclass and backgroundImage at runtime on creationComplete like:

borderContainer.setStyle("backgroundImage","assets/images/back.png");
btnRefresh.setStyle("skinClass",CustomButtonRefreshSkin);

Hope, it will help someone else.

ketan
  • 19,129
  • 42
  • 60
  • 98