1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" initialize="initNew()"
width="320" height="370">
<mx:Script>
<![CDATA[
import flash.display.Graphics;
private function initNew () : void
{
var rectangleUni:Shape = new Shape();// Instance de l'objet d'affichage
rectangleUni.graphics.beginFill(0x86B1FB);// Le rectangle sera rempli de bleu
rectangleUni.graphics.drawRect(0, 0, 100, 30);// dessin du rectangle avec la méthode drawRect(x, y, width, height)
// Positionnement et affichage du rectangle dans la séquence
rectangleUni.x = rectangleUni.y = 50;
addChild(rectangleUni);
}
]]>
</mx:Script>
</mx:Application> |
Partager