Start the Flash program. Click "Flash File(ActionScript 3.0)" from the splash window to create a new file for an AS3 Flash animation project.
Select "Actions" from the "Window" menu on the main Flash menu bar to open the ActionScript 3 editor.
Position your mouse cursor on the first line of the ActionScript 3 editor. Click your mouse button, and type in the code below to create and place a TextField on the flash stage that has a width of 1,000 pixels and a height of 1,000 pixels:
var displayText:TextField = new TextField();
displayText.width = 1000
displayText.height = 1000
displayText.multiline = true;
var tf:TextFormat = new TextFormat();
tf.size = 20;
tf.font = "Times New Roman"
The TextField will also support text on multiple lines and display the text with a 20 point Times Roman font.
Type the following code into the ActionScript 3 editor starting on the next line:
displayText.htmlText = "<html><body><p>Formatted in Plain Text</p><p><B>Formatted in Bold Text</B></p><p><i>Formatted in Italic Text</i></p></body></html><P>the equation\n\nV= 1*PI*1²</P><P><img src = 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Cycnus_Picart-detail.jpg/120px-Cycnus_Picart-detail.jpg'></P>"
This code stores the HTML formatted text on the right-hand side of the equals sign in the displayText TextField variable.
Type the following code in the next line of the ActionScript 3 editor:
displayText.setTextFormat(tf);
addChild(displayText);
This applies the text formatting to the displayText TextField, and places the displayText TextField on the Flash stage.
Copy and paste the following code, if you did not type in the preceding code already, or replace the code you already typed, to ensure that there are no syntax errors and the AS3 HTML rendering program runs correctly.
var displayText:TextField = new TextField();
displayText.width = 1000
displayText.height = 1000
displayText.multiline = true;
var tf:TextFormat = new TextFormat();
tf.size = 20;
tf.font = "Times New Roman"
displayText.htmlText = "<html><body><p>Formatted in Plain Text</p><p><B>Formatted in Bold Text</B></p><p><i>Formatted in Italic Text</i></p></body></html><P>the equation\n\nV= 1*PI*1²</P><P><img src = 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Cycnus_Picart-detail.jpg/120px-Cycnus_Picart-detail.jpg'></P>"
displayText.setTextFormat(tf);
addChild(displayText);
Click "TestMovie" option within the "Control" menu to play the Flash AS3 HTML rendering program. Observe that the text is displayed and formatted in plain, bold and italic text, that the XML character is rendered as the superscript 2, the text is in 20 point Times Roman format and that the picture at the WikeMedia Common's URL is rendered.