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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what with the extra display in the text box via the array

Status
Not open for further replies.

vimmy

Programmer
Jan 25, 2004
1
CA
an extra unwanted in array
Hello, i have this issue that the values from an external page are loading but there seems to be an extra value in the array and i can't get rid of it. I'm loading values with the loadVariablesNum and the values are in this format from the page loading from:

&output1=Currie Palace,&output2=take out,&output3=132 street west,&output4=3OjaOOp_0TrluOjjFGwJmd4pRQs-,&output5=9-5pm,&output6=happy hour after 5,&output7=321-3214,&output8=additional1,&output9=additional2,&output10=page222.asp,&Counter=1

on a later frame in the movie i check to see if Counter == 1 and if so move on to display the string in a text box. When i display it in the text box the string is intrepreted & displayed correctly but under the string is blank spaces, i tested the interpretation of the string with the word 'Phone:' like so:
info.htmlText += &quot;<font size=\&quot;13\&quot;><b>Phone: </b>&quot;+ phone_array +&quot;</font><br>&quot;;

and the text box displayed the value of phone in the string but when the array goes on to the next value set (in this case there is none, but i happens regardless of more that 1 value) anyway the array goes on to display another set with empty values.

So the text box looks like so just with the phone_array
Phone: 321-3214

Phone:

Why do i get a duplicate Phone when there is only 1 value in the array. This is the script i'm using to display in the text box called &quot;info&quot;:

phone_length = phone_array.length;

phone_array = output7.split(&quot;,&quot;);

for (i=0; i<rname_length; i++) {

info.htmlText += &quot;<font size=\&quot;13\&quot;><b>Phone: </b>&quot;+ phone_array +&quot;</font><br>&quot;;
}

produces:
Phone: 321-3214

Phone: <--- why an extra?

as you can see in the string output7=321-3214, there are no other values. How can i fix it so that the array doesn't display an extra in the text box?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top