1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| <?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" activate="init(event)">
<fx:Declarations>
<!-- Placer ici les éléments non visuels (services et objets de valeur, par exemple). -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayList;
import mx.controls.Alert;
public function init(evt:Event):void
{
var spr:Sprite = new Sprite();
spr.graphics.beginFill(0xFF0000);
spr.graphics.drawRect(0, 0, 800, 200);
stage.addChild(spr);
Alert.show("coucou !");
var liste:ArrayList = new ArrayList();
for(var i:int = 0; i<10; i++)
{
liste.addItem(i);
}
cb.dataProvider = liste;
}
]]>
</fx:Script>
<s:ComboBox id="cb" x="226" y="136" width="221" requireSelection="true"/>
</s:WindowedApplication> |
Partager