Skip to main content
Participant
February 5, 2008
Question

What Goes Where andhow to email!

  • February 5, 2008
  • 7 replies
  • 363 views
Hello

Looking for a little help here, this is the first time i would have written AS im more a PHP man but have used flash alot to create more movie type interatcive sites anyway im using FLASH CS3

I have 4 Text Inputs and a Button with instances

name_box
email_box
tele_box
Message_box
send_btn

There on a Graphics Symbol thats inside a Movie Symbol thats placed in the main screen on frame 169
on frame 172 is animation that i would like to show while the data is being sent frame 173 is an error and 174 is the confirm

The PHP file im trying to post these to is working fine (with other HTML websites)

Now this is what i have got in the action script inside a layer on the graphic symbol that holds the fields:

stop();
System.useCodepage = true;
send_btn.onRelease = function() {
my_vars = new LoadVars();
my_vars.name = name_box.text;
my_vars.email = email_box.text;
my_vars.tele = tele_box.text;
my_vars.message = message_box.text;
if (my_vars.name != "" and my_vars.email != "" and my_vars.message != "") {
my_vars.sendAndLoad("mailer.php", my_vars, "POST");
gotoAndStop(172);
} else {
gotoAndPlay(173);
}
my_vars.onLoad = function() {
gotoAndStop(174);
};
};

After this not working it tried placing gotoAndPlay.root(frame number) but this didn't work and tried placing the original action script on the main in a layer of its own

Anyone have any ideas to how i could get the to work?

Thank you in advanced
This topic has been closed for replies.

7 replies

-HC-Author
Participant
February 8, 2008
That you for getting ack to me again, however i should of posted sooner that i had fixed the problem,

It was so simple its embarsing, i have forgoten to name the error_clip instance name to error_clip, as soon as i noticed and changed it, the scrips worked like a dream.

Thank You anyway
Inspiring
February 5, 2008
I just noticed this:
>>in the graphic symbol where the input fields are or on the main timeline?

You fields are inside a MovieClip? Well then you can't just say
email_box.text since there is no email_box instance in your code's scope.
You'd need: clipInstance.email_box.text



--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


Inspiring
February 5, 2008
AS should only go in the main timeline.

>>my_vars.sendAndLoad("mailer.php", my_vars, "POST");

You should probably be using a full URL here:

my_vars.sendAndLoad(" http://www.mydomain.com/scripts/mailer.php", my_vars,
"POST");


--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


-HC-Author
Participant
February 5, 2008
i have had a good look through the help section but im still non the wiser to why this isn't working?
-HC-Author
Participant
February 5, 2008
also where should the AS be? in the graphic symbol where the input fields are or on the main timeline?
-HC-Author
Participant
February 5, 2008
well you hit the send button and nothing happens, the text stays in the fields there is no change to the movie at all, i dont get any email ether, the PHP is doing $request
Inspiring
February 5, 2008
What exactly is not working and how do you know it's not working? Couple
things - POST does not work from the IDE - so if you want to test from the
IDE, you need to change your PHP to use $GET or $REQUEST. Also, it's not a
good idea to use just one LoadVars. See the example in the Help regarding
sendAndLoad.

--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/