I am trying to make a program combine two strings to make a name...
My code is
function addStudent(evt: MouseEvent)
{
var tempFirst = newStudent.firstName.text;
var tempLast = newStudent.lastName.text;
var tempStartDate = String(newStudent.startDate.text);
var tempBirthDate = String(newStudent.birthDate.text);
numStudents++;
var tempName = newStudent.firstName.text + newStudent.lastName.text;
trace(tempName);
studentList.dataProvider.addItem({label: tempName, data: tempName});
var tempStudent:student = new student(tempFirst, tempLast, tempStartDate, tempBirthDate);
studentHolder.addChild(tempStudent);
listStudents();
}
what the trace returns (if I input Jack Rob) is:
Jack
Rob
instead of JackRob
newStudent.firstName.text points to a movie clip called newStudent, with an input box called firstName
I have tried:
var tempFirst = String(newStudent.firstName.text);
var tempLast = String(newStudent.lastName.text);
var tempName = newStudent.firstName.text + newStudent.lastName.text;
var tempName = (newStudent.firstName.text).concat(newStudent.lastName.text);
var tempName = String(newStudent.firstName.text) + String(newStudent.lastName.text);
most of those were just me grasping at straws and hoping maybe something would work
essentially the goal is for the user to input a first and last name, and that first and last name is inputted into the dataProvider as one single string (JackRob)
I appreciate any help anyone can give, thank you in advance