-
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
-
Lifesaver
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.
-
sorry.. im a newbie to this stuff.. how would i call it back?
-
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?"
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|