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!

Assigning variables accessed through javascript to movie clip

Status
Not open for further replies.

techdiver

Technical User
Mar 9, 2002
9
US
Hi all,

I have imported variables from an HTML form using javascript. No problems there - text fields in my movie display imported values. The problem is that I am trying to control the length (_yscale) of a movie clip by assigning it a vlaue that has been imported and nothing seems to be working. Suggestions?

CD
 
If you can see the values in the text fields then it should be easy enough to use them to set movieclip properties. Maybe a variable type mismatch - are the values strings? You can convert back with number(). Although actionScript is loosely typed and this rarely causes a problem. Have you run a trace() statement on the variables to see exactly what they're returning? Slainte

 
I think wangbar is right, there ... any imported variables come in as strings. To get a number out of it you'll have to use the number conversion.

One other thing ... if the result of the number converstion comes out as NaN, you have some trailing trash on the variable. I discovered this working with TXT files ... the last variable in a TXT file created in notepad ususally contains code for a new line (\r\n, or sometimes just \n), and reeks merry havoc with number typed variables. I'm guessing you're not going to have that problem, but the only way I found to get rid of it was to include a throw-away variable at the end of the TXT file, something like "&garbage=0".

Anyways, that was probably completely useless - ignore my ranting!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top