This applies the text formatting to the displayText TextField, and places the displayText TextField on the Flash stage.Ĭopy 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.Ĭlick "TestMovie" option within the "Control" menu to play the Flash AS3 HTML rendering program. Type the following code in the next line of the ActionScript 3 editor:ĭtTextFormat(tf) addChild(displayText) The citrus engine is a professional-grade, scalable actionscript 3 game engine.
#MAKE A REPLAY BUTTON IN FLASH ACTIONSCRIPT 3.0 FULL#
This code stores the HTML formatted text on the right-hand side of the equals sign in the displayText TextField variable. Flash and its programming language actionscript have full support for.
Type the following code into the ActionScript 3 editor starting on the next line:ĭisplayText.htmlText = "Formatted in Plain TextFormatted in Bold TextFormatted in Italic Textthe equation\n\nV= 1_PI_1²" It used to be so easy to create outbound links in Flash with just a single line of code inside the onRelease event for your buttons. The TextField will also support text on multiple lines and display the text with a 20 point Times Roman font. For those of you who are new to ActionScript 3, you might be wondering what happened to the getURL() function. 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" 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: Position your mouse cursor on the first line of the ActionScript 3 editor.
Select "Actions" from the "Window" menu on the main Flash menu bar to open the ActionScript 3 editor.