I am not much of a scripter lol...
and this is relatively new to me..
but i asked a question about something like this a long time a go...
so i am going to ask here again, because now i know a little more about what i am on about
anyway
I have this code on a button in my movie
on (release)
{
errorMsg.text = 'Please insert a username'
if((Name.length > 0))
errorMsg.text = 'Please insert a password'
if((Password.length > 0))
errorMsg.text = 'Please insert an email address'
if((Email.length > 0))
errorMsg.text = 'Please insert a team name'
if((Team.length > 0))
if((errorMsg.text == errorMsg.text))
}
- on (release)
- {
- errorMsg.text = 'Please insert a username'
- if((Name.length > 0))
- errorMsg.text = 'Please insert a password'
- if((Password.length > 0))
- errorMsg.text = 'Please insert an email address'
- if((Email.length > 0))
- errorMsg.text = 'Please insert a team name'
- if((Team.length > 0))
- if((errorMsg.text == errorMsg.text))
- }
I wanted this to check some text fields, to make sure the user inputs the all the right data into the input fields
now i want to add this code to the same button
var regVars = new LoadVars();
regVars.action = 'Submit';
regVars.Name = Name.text;
regVars.Password = Password.text;
regVars.Email = Email.text;
regVars.location = location.text;
regVars.Favourite_Team = Favourite_Team.text;
regVars.Team = Team.text;
regVars.sendAndLoad("Registration.php", regVars, "POST");
- var regVars = new LoadVars();
- regVars.action = 'Submit';
- regVars.Name = Name.text;
- regVars.Password = Password.text;
- regVars.Email = Email.text;
- regVars.location = location.text;
- regVars.Favourite_Team = Favourite_Team.text;
- regVars.Team = Team.text;
- regVars.sendAndLoad("Registration.php", regVars, "POST");
this should in effect send all the data from the text boxes to a phpscript, which i have set up to send to a Mysql database.
What i want to do is have both scripts on the same button...
whenever i try this i just get loads of errors...
this is what i thought it should look like originally
on (release)
{
errorMsg.text = 'Please insert a username'
if((Name.length > 0))
errorMsg.text = 'Please insert a password'
if((Password.length > 0))
errorMsg.text = 'Please insert an email address'
if((Email.length > 0))
errorMsg.text = 'Please insert a team name'
if((Team.length > 0))
var regVars = new LoadVars();
regVars.action = 'Submit';
regVars.Name = Name.text;
regVars.Password = Password.text;
regVars.Email = Email.text;
regVars.location = location.text;
regVars.Favourite_Team = Favourite_Team.text;
regVars.Team = Team.text;
regVars.sendAndLoad("Registration.php", regVars, "POST");
}
- on (release)
- {
- errorMsg.text = 'Please insert a username'
- if((Name.length > 0))
- errorMsg.text = 'Please insert a password'
- if((Password.length > 0))
- errorMsg.text = 'Please insert an email address'
- if((Email.length > 0))
- errorMsg.text = 'Please insert a team name'
- if((Team.length > 0))
- var regVars = new LoadVars();
- regVars.action = 'Submit';
- regVars.Name = Name.text;
- regVars.Password = Password.text;
- regVars.Email = Email.text;
- regVars.location = location.text;
- regVars.Favourite_Team = Favourite_Team.text;
- regVars.Team = Team.text;
- regVars.sendAndLoad("Registration.php", regVars, "POST");
- }
but, it seems that the code only gets to the
errorMsg.text = 'Please insert a team name'
if((Team.length > 0))
- errorMsg.text = 'Please insert a team name'
- if((Team.length > 0))
and stops...
i dont know why
can someone please re-arrange this code for me, so it runs smoothly, and sends the variables properly