• home
  • forum
  • my
  • kt
  • download
  • Static and Dynamic Input Text Box

    Author: 2008-09-28 09:52:54 From:

    In Flash there are three types of text box:

    Static
    This is the most simple of the text boxes; you can't change its text on the run.

    Dynamic
    This text box allows you to change almost anything you could change while editing you flash movie.

    Input
    The same thing as the dynamic text, but this one accepts user input.

    You can change your text to one of these types right after drawing a text box on the stage.
    Free Flash Tutorials, Basic Tools, Static and Dynamic Input Text Box

    Let's create a simple movie to demonstrate their differences.
    Draw a new Static text box, and write "Name:" on it.
    Free Flash Tutorials, Basic Tools, Static and Dynamic Input Text Box

    Draw an Input text box next to the previous text. Give an instance name of "iText" and set the "var" to "_root.name". Free Flash Tutorials, Basic Tools, Static and Dynamic Input Text Box
    "_root.name" is going to be the variable that holds the contents of this text box.
    If the user types something on the Input box, the variable "_root.name" will have that same text.

    Finally draw a dynamic box with these properties:
    Free Flash Tutorials, Basic Tools, Static and Dynamic Input Text Box

    Open the actions for the first frame and paste:
    //this is the variable for the input box var name = "name here" //this is the variable for the dynamic box var text = "" //if the text on the Input box is changed this event is called iText.onChanged = function() { _root.text = "Hello " + _root.name + "! " + "How are you today?"; }

    This is the result:
    Free Flash Tutorials, Basic Tools, Static and Dynamic Input Text Box

    That was the basics of Text Box, I hope you liked it.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      3D (20)
      Math Physics (14)
      3rd Party (5)
      Navigation (60)
      Actionscripting (26)
      Optimization (16)
      Animation (32)
      Projector (9)
      Audio (46)
      Special Effects (112)
      Backend (25)
      Text Effects (65)
      Drawing (18)
      Tips and Techniques (41)
      Dynamic Content (25)
      Tricks (6)
      Games (66)
      Utilities (19)
      Getting Started (79)
      Video (24)
      Interactivity (43)
      Web Design (29)

    New

    Hot