Component Event(s):

-          There are three events, from which two events for Image component & one event is for Buttons (for changing the Application skin & store it in the configuration file).

 

      private function evntMoveMe():void

      {

            thisWin.startMove();

      }

     

      private function evntCloseMe():void

      {

            thisWin.close();

      }

     

      private function evntChangeSkin(event:MouseEvent):void

      {

            var tmpObj:Button = event.currentTarget as Button;

            // changing the skin value

            configData.skin = tmpObj.label;

            // change the application look with the new skin

            changeSkin(tmpObj.label);

            // update config file

            updateConfig(tmpObj.label);

      }

 

-          “startMove()” method is used to move the main Application window. We are calling this method on the “mouseDown” event of the image component (evntMoveMe()). Moving process of the window will be automatically ended on “mouseUp” event, so we don’t need to declare that event.

 

-          “close()” method is used to close the window. This method unloads the contents of the window; basically it’ll close the Application. (You may need to read more in AIR documentation, in-case your Application is dealing with multiple windows).

o   In this Application, we are using this method on the “doubleClick” event of the image component (evntCloseMe()), so when user double clicks on the Application interface (internally its image which is dispatching this event) we are closing the Application.

 

-          evntChangeSkin()” method is used to change the skin. It is attached with click event of all buttons. Method will change the skin as well as store it in the configuration file.

o   Method first changes the value in XML data object.

o   Then it’ll change the source of the Image component, from the resource folder, using “changeSkin()” method.

o   Finally it’ll update the file with this updated skin data.