+ Reply to Thread
Results 1 to 6 of 6

Thread: Flash Environment: The Text Tool

  1. #1
    Join Date
    Mar 2008
    Posts
    7,145
    Rep Power
    86

    Flash Environment: The Text Tool

    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:

    http://www.codecall.net
    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.

    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.
    Attached Thumbnails Attached Thumbnails Flash Environment: The Text Tool-static.jpg   Flash Environment: The Text Tool-stage.jpg  
    Attached Images Attached Images  

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: Flash Environment: The Text Tool

    Very nice! The pics help a lot. +rep

  4. #3
    Join Date
    Mar 2008
    Posts
    7,145
    Rep Power
    86

    Re: Flash Environment: The Text Tool

    Thanks. You know I probably should use more pictures but I get lazy with screen captures.

  5. #4
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Flash Environment: The Text Tool

    You should make your next one on the pen tool, most people do not like it.

    +rep!

  6. #5
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: Flash Environment: The Text Tool

    Screen captures are the key to documentation/tutorials. +rep
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  7. #6
    Join Date
    Mar 2008
    Posts
    7,145
    Rep Power
    86

    Re: Flash Environment: The Text Tool

    Great I will do that in the next one. I'll use more pictures also.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using Environment Variables
    By AIGuy in forum C and C++
    Replies: 5
    Last Post: 01-23-2011, 02:56 PM
  2. Replies: 4
    Last Post: 10-27-2010, 10:15 PM
  3. What's your favorite programming environment/text editor?
    By DarkLordofthePenguins in forum The Lounge
    Replies: 33
    Last Post: 10-01-2010, 02:49 AM
  4. C/C++ environment
    By Roman Y in forum C and C++
    Replies: 14
    Last Post: 08-25-2010, 06:57 AM
  5. Linux 3d Environment
    By Jordan in forum Technology Ramble
    Replies: 7
    Last Post: 09-16-2006, 05:49 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts