MaryAnneL
07-29-2009, 12:51 PM
Hi all. I'm brand new to AS3 and have a question on text fields and text formats. :D
Here's my current timeline code (OOP is my *next* challenge):
var displayContainer_mc:MovieClip = new MovieClip();
addChild (displayContainer_mc);
var mcFeedbackText:TextField = new TextField();
//add movie clip to parent movie clip container:
displayContainer_mc.addChild (mcFeedbackText);
//set screen X and Y coordinates:
mcFeedbackText.x=10;
mcFeedbackText.y=10;
//define feedback text properties:
mcFeedbackText.width=200;
mcFeedbackText.height=125;
mcFeedbackText.multiline=true;
mcFeedbackText.wordWrap=true;
mcFeedbackText.selectable=false;
mcFeedbackText.antiAliasType="normal";
//apply text format:
var txfFeedbackText:TextFormat = new TextFormat ();
txfFeedbackText.font="Tahoma";
txfFeedbackText.size=11;
txfFeedbackText.color=0x000000;
mcFeedbackText.defaultTextFormat=txfFeedbackText;
mcFeedbackText.htmlText= "This is the<b> default </b>text in the text field.";
This works, but is it the preferred way to do this?
Any suggestions?
Thanks!
MA
Here's my current timeline code (OOP is my *next* challenge):
var displayContainer_mc:MovieClip = new MovieClip();
addChild (displayContainer_mc);
var mcFeedbackText:TextField = new TextField();
//add movie clip to parent movie clip container:
displayContainer_mc.addChild (mcFeedbackText);
//set screen X and Y coordinates:
mcFeedbackText.x=10;
mcFeedbackText.y=10;
//define feedback text properties:
mcFeedbackText.width=200;
mcFeedbackText.height=125;
mcFeedbackText.multiline=true;
mcFeedbackText.wordWrap=true;
mcFeedbackText.selectable=false;
mcFeedbackText.antiAliasType="normal";
//apply text format:
var txfFeedbackText:TextFormat = new TextFormat ();
txfFeedbackText.font="Tahoma";
txfFeedbackText.size=11;
txfFeedbackText.color=0x000000;
mcFeedbackText.defaultTextFormat=txfFeedbackText;
mcFeedbackText.htmlText= "This is the<b> default </b>text in the text field.";
This works, but is it the preferred way to do this?
Any suggestions?
Thanks!
MA