What am I doing wrong in the code below? I just want to stick a label to the stage.
I know I can <mx:label text=“hello world”> but I want/need to use this method because I have an AS class that needs a stage reference.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Label;
private static var labeltje:Label = new Label();
labeltje.text = "Hello World";
stage.addChild(labeltje);
]]>
</mx:Script>
</mx:Application>
1120: Access of undefined property stage