A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: HELP!! Entering a variable and then displaying it later in a movie.

  1. #1
    Member
    Join Date
    Feb 2001
    Posts
    42

    HELP!! Entering a variable and then displaying it later in a movie.

    Hello my fellow flashers

    May i please get some help on making a box where you enter a variable ie- persons name into a box and then later appearing in a body of text? or in the movie?

    thx

  2. #2
    Lifesaver Lightwave Network's Avatar
    Join Date
    Sep 2002
    Location
    Denver, CO, USA
    Posts
    649
    Create an Input Text field, give it a var name. When someone types their name into it, the variable will return the new value.

    So, later, you can call the variable into any other dynamic text field.


    ... gimme just one more line of code to ease the pain.

    http://www.ln.tv
    http://www.davevillano.com
    http://www.premierloftsdenver.com
    http://www.backyard.cc -- coming soon!


  3. #3
    Member
    Join Date
    Feb 2001
    Posts
    42
    sorry.. im a newbie to this stuff.. how would i call it back?

  4. #4
    Flash goddess
    Join Date
    Jan 2002
    Location
    San Francisco, CA
    Posts
    68
    Hi flash_nerd,
    What you need to do is make an input text field. Go to Properties and where it says "Static text" go to "Input text" instead. Give your text field an instance name such as "input_txt". Then you probably want to make a submit button or something so that the user can tell you when she is done entering her name. Let's say you call the button instance submit_btn.
    Then you can write a function for the button that will store what the user entered in a variable that you can use later on.
    Code:
    submit_btn.onRelease = function() {
        // make sure input isn't blank
        if (input_txt.text != null && input_txt.text != "") {
            name_variable = input_txt.text;
        }
    }
    You can then use the name_variable later on. You could have another text field later in the movie. Make it a dynamic text field. Name it, say, "display_txt". You can display your variable in it like so:
    Code:
    display_txt.text = "Hi " + name_variable + ", how are you doing?";
    Hope this helps.
    "You hung up on my Nana? You told my Nana to drop dead?"

  5. #5
    Member
    Join Date
    Feb 2001
    Posts
    42
    thanks alot

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center