You need to follow the instructions at
http://livedocs.adobe.com/flex/3/langref/ExampleInstruct.html to run
ActionScript examples.

Either follow steps 1 - 5 (Which I did with your example and it works)
or use the instructions in the "Note:" (Which I didn't try).


--- In [email protected], "tchredeemed" <[EMAIL PROTECTED]> wrote:
>
> How do you add a TextField to the screen?
> 
> I tried using the same example from the dynamic help, but nothing is
> appearing...
> 
> package assets {
> import flash.display.Sprite;
> import flash.text.TextField;
> import flash.text.TextFieldAutoSize;
> import flash.text.TextFormat; 
>       
> public class RMText extends Sprite {
> private var label:TextField;
> private var labelText:String = "Hello world and welcome to the show.";
>               
> public function RMText() {
> configureLabel();
> setLabel(labelText);
> }
> 
> public function setLabel(str:String):void {
> label.text = str;
> }
> 
> private function configureLabel():void {
> label = new TextField();
> label.autoSize = TextFieldAutoSize.LEFT;
> label.background = true;
> label.border = true;
> 
> var format:TextFormat = new TextFormat();
> format.align = 'left';
> format.font = "Verdana";
> format.color = 0xFF0000;
> format.size = 10;
> format.underline = true;
> 
> label.defaultTextFormat = format;
> addChild(label);
> }
> }     
> }
> 
> 
> ------------------------------------
> 
> This does not seem to do anything... For some reason when I add this
> to the screen I cannot see anything, but I am not sure why, as I
> copied it directly from dynamic help...
> 
> Any ideas? (UITextField causes the same issue)...
>


Reply via email to