- Home /
How would I get an array value?
I have an array for string, one for a username the other for password.
I want to grab the values from the array so I can use them as part as my login script but i'm not too sure how I would do this.
// This is the part of the script where i want to get the values from the textbox defined in my array.//
function Login() {
var username = textbox;
var password = "";
var form = new WWWForm();
//form.AddField( "myform_hash", unity.hash );
form.AddField( "myform_username", username );
form.AddField( "myform_password", password );
//My array is a simple//
var textbox : String[];
Thanks.
Answer by Bunny83 · Mar 26, 2012 at 03:31 PM
I have actually no idea what's the point of this question. Do you want to read an element of your string array?
var username = textbox[0]; // First element
Answer by badProphet · Mar 26, 2012 at 04:20 PM
Use the code Bunny83 gave you and put it in a for loop. You can step through the string array and feed in characters to a new string.
Your answer
Follow this Question
Related Questions
Get list of nearby targets (JS) 1 Answer
A node in a childnode? 1 Answer
Enabled all gameobjects in array 1 Answer
Lists and Structs instead of Arrays? 4 Answers
Find specific element when duplicates exist in list. 1 Answer