ActionScript The Text Tool
In the toolbox there is a symbol that looks like a T this is for typing text on the stage.
The symbol looks like this:
Click on the text tool and click and drag on the stage. In the text field, you will type something. I typed "CodeCall". When you click on the text that you wrote, you will see lots of properties in the properties window that you can change. They include: font family, font style, font size, color, and much more. What I am going to look at is the drop down box that says static text.
You can set properties of static text like superscript, subscript, and selectable.
Static text is like a label in that the value can't be changed at runtime.
Look in the properties for a set of buttons like this:
The two buttons to the far right are superscript and subscript. The one that I have an arrow pointing to means that the user can highlight the text with the mouse. You can't interface with static text at runtime so you can't give it an instance name.
Dynamic Text
With Dynamic Text you can render the text as HTML and show borders. Also with this type you can give it an instance name and you can modify the text at run time with ActionScript code.
With the text tool, add some more text to the stage and have it say "Dynamic CC". In the properties look fora combo box that says "static text" change that to say "dynamic text".
By default, dynamic text fields are selectable by default. Change the instance name to txtDynCC. This will allow us to modify it with Action Script code.
In the properties window, look for an options drop down and you will see a link setting. In that text field type:
When you run the program, you will notice now that the text field acts as a link. This is the same as what we saw in the last tutorial on formatting with CSS. The difference is you can format the text field without any code.http://www.codecall.net
Play around with the various properties to become acquainted with what there is you can do.
On the stage, you can resize the text with the little blue handles.
My clip looks like this:
Now, run the flash movie and see what it looks like.
Input Text
The last thing we are going to look at is input text fields. Using the text tool add some more text to the stage. However, don't include any text on it. You will notice that the field keeps the settings from last time. You might want to change these back to some default settings.
Using the combo box, change the field to "input text". Change the instance name to txtInput. This allows us to access the item in action script code. We aren't going to do any action script code but you could read the users input and process it in some way.
Using the properties, you will want to find a button to show a border. Above I showed some tools that allow you to make text superscript and subscript. The button is just to the left of the superscript button.
When you run the program, you can type text in the field.
Easy. When you write code to do things like this, you get to appreciate how they truly work but the reality is you want to do things as fast as you can. This is with the flash toolbox.
You can view the resulting clip: here.
Very nice! The pics help a lot. +rep
Thanks.You know I probably should use more pictures but I get lazy with screen captures.
![]()
You should make your next one on the pen tool, most people do not like it.
+rep!
Screen captures are the key to documentation/tutorials. +rep
Great I will do that in the next one. I'll use more pictures also.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks