I have a combobox in frame 3 of my movie clip. In frame 4, I’m trying to access the value of the combobox from inside a function:
submitListener = new Object();
submitListener.click = function()
{
//code to submit data
var registerVar = new LoadVars();
registerVar.FirstName = FirstName;
registerVar.LastName = LastName;
registerVar.Company = Company;
registerVar.Email = Email;
registerVar.Phone = Phone;
registerVar.Fax = Fax;
registerVar.City = City;
registerVar.State = State;
registerVar.Zip = Zip;
//combo box value
registerVar.Title = Title.value;
registerVar.sendAndLoad("/Register/register_process.php",registerVar, "POST");
registerVar.onLoad = function(success) {
if (success) {
strResult = this.strResult;
}
}
};
submit.addEventListener(“click”, submitListener);
All the other variables are accessible (which were also defined in the previous frame). But the Title.value ( Title is a combobox) is giving a value of undefined inside this function. OUTSIDE of this function, it’s value is correct.
I know it’s a scope thing, but don’t understand why the other variables have scope and just this combobox doesn’t…
Help!!!Please