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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| package
{
import nl.demonsters.debugger.MonsterDebugger;
import flash.text.TextFormat;
import flash.text.TextField;
import flash.events.Event;
import flash.display.Sprite;
public class Main extends Sprite
{
private var debugger:MonsterDebugger;
public function Main()
{
// attend la fin de l'initialisation de la scène
this.addEventListener(Event.ADDED_TO_STAGE, onReady, false, 0, true);
}
/**
* Démarrage de votre application.
*
*/
protected function onReady(event : Event) : void
{
this.removeEventListener(Event.ADDED_TO_STAGE, onReady);
// Init De MonsterDebugger
debugger = new MonsterDebugger(this);
// message de debug
MonsterDebugger.trace(this, "Start Application");
// le code de notre application
var oText:TextField = new TextField();
oText.width = stage.stageWidth;
oText.autoSize = 'center';
oText.text = "Bienvenue sur ActionScript-Facile";
oText.y = 150;
var tFormat:TextFormat = new TextFormat();
tFormat.font = "Arial";
tFormat.size = 20;
tFormat.color = Math.random() * 0X00FFFFFF;
oText.setTextFormat(tFormat);
addChild( oText );
MonsterDebugger.trace(this, oText);// affichage dans le debug de notre objet oText
}
}
} |
Partager