Beginners Flash Tutorial – Creating Dynamic Text
October 20, 2008 by admin
Filed under CSS and XHTML, Flash Tutorials
High Quality Flash Tutorial Videos – Taught by Experts
We also have extensive Adobe Flash Tutorials in high quality video format. These are ideal for beginners who need to master Flash quickly
Title / Free Demo : Adobe Flash CS3 Tutorial Videos
Author: James Gonzalez
Duration: 11 Hours – Lessons: 125
Creating Dynamic Text with Flash
This tutorial has been prepared with relation to Flash 8, although the principles covered apply to all versions; the code included is based on ActionScript 2.0
This Flash tutorial introduces the creation, editing and formatting of dynamic text and embedding fonts.
There are two main ways to create a dynamic text field in Flash, one using the flash interface and the other using ActionScript, this flash tutorial will give you a fundemental understanding of this works.
Create a textfield using the interface



With the new layer selected, open the Actions panel either by pressing F9, clicking on the Actions tab if it is visible, or choosing Window > Actions. Type the following code into the actions panel:
my_txt.text="new text"



- Select your dynamic textfield on the stage and click the Embed button on the Properties panel, then choose Basic Latin (select OK):

- On the library panel (Window > Library if it isn’t open) select the options button:
Select New Font and enter the following details:
Press OK and you’ll see your font appear in the library. Right-click (CTRL+Click for Macs) on the font in the library and choose Linkage. Click the checkbox next to ‘Export for ActionScript’:
This allows you to refer to the font in your ActionScript code (the procedure is the same for any library item that you want to control using ActionScript). Select your code (‘actions’) layer and enter the following code (after your existing line):
my_txt.embedFonts=true var tf:TextFormat=new TextFormat() tf.font="myfont" my_txt.setTextFormat(tf)

Tutorial on Creating a dynamic textfield using ActionScript
var other_txt:TextField = _root.createTextField("other_txt", _root.getNextHighestDepth(), 20, 20, 200, 50) other_txt.text="other text"
Select All
createTextField(instanceName, depth, xPosition, yPosition, width, height)
Try not to be put off by the code if you’re not familiar with ActionScript. A good way to familiarise yourself with it is to experiment by changing some of the parameters (e.g. change the y position to 100 and you’ll see the text appear further down). To format this text, you need to use the ActionScript approach outlined above.
Comments
Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!
You must be logged in to post a comment.