Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEW TO FLASH: Passing a URL Variable to a text field

Status
Not open for further replies.

JoeMcGarvey

Programmer
Oct 31, 2002
47
US
Hi,
I am trying to pass a url variable into Flash to replace the value in a text box with that variable.

1. What kind of text box should I create? Static/Dynamic/Input? I created a button symbol and gave the text box an instance name of "ButtonText"...

2. What is the action script syntax to reference that text box?

Does anyone have a canned example of this?
Joe McGarvey - Web Application Developer
Paragraph, Inc. - Paragraph Publisher -
 
it has to be a dynamic text box.

how are you passing the variable into flash? diificult to be more specific without that knowledge but essentially if you give the text box a variable name equal to the variable name of the text being passed all will be well.
 
then just give the dynamic text box a variable name of Buttontext
 
Ok... it works if I set an action script:

ButtonText = "hello";

How do I load the variable value from the url?

This did not work:

var theText = _root.ButtonText; //my url variable
ButtonText = theText;
Joe McGarvey - Web Application Developer
Paragraph, Inc. - Paragraph Publisher -
 
you dont need any action script for this to work ....once the variable has loaded the text field will show the content
 
Seems simple... but it's not working. Using FlashMX...

Maybe I am missing something:

1. I have a button symbol in the Library named "TheButton"
2. "TheButton" has a dynamic text field with an instance name of "theTextBox" and a variable named "ButtonText"
3. "TheButton" symbol is placed in frame 1 of the scene
4. My HTML object tag passes a url variable called "ButtonText"


Joe McGarvey - Web Application Developer
Paragraph, Inc. - Paragraph Publisher -
 
can you post the fla....it will be quicker that way to sort this out...you dont seem to be doing anything wrong so its probably some small little thing that i may spot.
 
yes worked fine when i passed the variable from another movie using loadmovie("test.swf?buttontext=thisurl",clip);
so it ought to fine the way you are passing it. iam wondering if its the spaces in your text. try without spaces..if thats it can fix.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top