Archive pour la catégorie ‘Adobe’

Création d’un HelloWorld pour Flex SDK 3

Lundi 29 décembre 2008

Encore plus simple qu’auparavant, la nouvelle version du SDK permet en quelques lignes de créer une application basique. Pour la compilation lancer la commande mxmlc.exe avec le nom de votre fichier, ceci génere directement le fichier swf.

<?xml version="1.0" encoding="UTF-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:explorer="*"
width="100%" height="100%" pageTitle="Hello World http://themadmax.free.fr"
>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.CloseEvent;// Event handler function uses a static method to show
// a pop-up window with the title, message, and requested buttons.
private function clickHandler(event:Event):void {
Alert.show("Hello world", "Hello world", 3, this );
}
]]>
</mx:Script>
<mx:Panel title="Hello World Example"
height="75%" width="75%" layout="horizontal"
paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
<mx:Text width="100%" color="blue" textAlign="center"
text="Hello world"/>
<mx:Button label="Button" click="clickHandler(event)" />
</mx:Panel>
</mx:Application>