Groups | Blog | Home
all groups > flash (macromedia) > april 2007 >

flash (macromedia) : ActionScript instead of PHP?



nonybd
4/19/2007 10:55:15 PM
Hi,

Can Actionscript be used like PHP, but without reloading the page to exicute
it? Like submiting a form, but just going to another frame, not another web
page, sending an email, or doing things like getting info from the
?whatever=somevalue&somemore=anothervalue stuff, like in php with
$_POST['whatever'], and $_POST['somemore']? That would be really cool.
nonybd
4/19/2007 11:06:53 PM
Hi,

Just answered my own question! No, you can't, but there is an equivalent.
The LoadVars.sendAndLoad('url', 'target', ['method']). With it, you can submit
forms and such, without visiting the page! Isn't that cool!?
nonybd
4/20/2007 12:04:42 AM
Hi,

did some playing around with the LoadVars.sendAndLoad(); example in help, but
can't seem to get it to work. Here is what I have (on the button):

on (release) {
var fields:LoadVars = new LoadVars();
fields.user = fields.name.text;
fields.email = fields.email.text;
fields.mess = fields.message.text;
fields.LoadVars.sendAndLoad("sender.php", "POST");
gotoAndPlay(2);
}

It does not produce errors, when I debug it. Why doesn't it do it? Thanks.
ggshow
4/20/2007 3:24:37 AM
fields.LoadVars.sendAndLoad("sender.php", "POST");

change it to

nonybd
4/20/2007 3:25:49 PM
nonybd
4/20/2007 9:03:21 PM
ggshow
4/21/2007 4:46:58 AM
You are welcome.
& I'm also here to learn :smile;
AddThis Social Bookmark Button