/* Open a new FLash file (ActionScript 3.0). Select TimeLine --> Top Layer --> Frame 1 Select Window --> Actions (F9) Copy and paste this snippet Observe the stage */ // This time we'll just apply the effect to a single word. import flash.text.TextField; import flash.text.TextFormat; import flash.text.TextFieldAutoSize; var myTextField:TextField = new TextField(); myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.selectable = false; myTextField.background = true; myTextField.text = "Now is the time for all good frogs to come to the aid of their pond."; // Now we define the format same as before but we do it using the parameter approach // TextFormat(font:String, size:Object, color:Object, bold:Object, italic:Object, underline:Object, url:String, target:String, align:String, leftMargin:Object, rightMargin:Object, indent:Object, leading:Object) var newFormat:TextFormat = new TextFormat("Arial", 14, 0x22FF22, true, false, false, "", "", "center", 0, 5, 0, 0); // This time we apply the font to just the word time. We count characters from 0. myTextField.setTextFormat(newFormat, 11, 15); this.addChild(myTextField); // // TextFormat(font:String, size:Object, color:Object, bold:Object, italic:Object, underline:Object, url:String, target:String, align:String, leftMargin:Object, rightMargin:Object, indent:Object, leading:Object) // Creates a TextFormat object with the specified properties. // // // http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextFormat.html