<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white"
initialize="init();">
<mx:Script>
<![CDATA[
import mx.containers.ApplicationControlBar;
import mx.controls.Alert;
import mx.controls.Button;
import mx.controls.Image;
private var button1:Button;
private var button2:Button;
private var button3:Button;
private var img:Image;
private function init():void {
button1 = new Button();
button1.label = "Flash";
button1.addEventListener(MouseEvent.CLICK, function():void {
img.source = "assets/fl_appicon.jpg";
});
button2 = new Button();
button2.label = "Flash Player";
button2.addEventListener(MouseEvent.CLICK, function():void {
img.source = "assets/fl_player_appicon.jpg";
});
button3 = new Button();
button3.label = "Flex";
button3.addEventListener(MouseEvent.CLICK, function():void {
img.source = "assets/fx_appicon.jpg";
});
var appControlBar:ApplicationControlBar = new ApplicationControlBar();
appControlBar.dock = true;
appControlBar.addChild(button1);
appControlBar.addChild(button2);
appControlBar.addChild(button3);
Application.application.addChildAt(appControlBar, 0);
img = new Image();
img.source = "assets/fx_appicon.jpg";
img.width = 100;
img.height = 100;
img.addEventListener("sourceChanged", image_sourceChanged);
addChild(img);
}
private function image_sourceChanged(evt:Event):void {
Alert.show(evt.toString(), evt.type);
}
]]>
</mx:Script>
</mx:Application>