PDA

View Full Version : Post Action


karlzoe2
02-20-2003, 03:22 AM
are there n e tutorials on the post action.....I am not sure where to start in flash.

this is what I want to do:

I want my users to subscribe to my ezine so when the enter their email address and click the button it gets my asp file which has a message thanking them for subscribing.


Will some one please give me a hint start or point me to a tutorial...thanks

bluegel
02-20-2003, 10:34 AM
you need to put an action on the button such as an

onPress
gotoAndStop( )

but i could be wrong so don't quote me on that.

just a suggestion

:p

fgf
02-20-2003, 02:19 PM
rough code

on (release){
loadVariables ("myscriptinsamefolder.asp" , "get")

}

after variables have been set in the same time line with all the details you wan't. (all variable in current timeline will be sent).

Your asp script will get the variables just as if sent from an html form using get.

fgf

karlzoe2
02-21-2003, 11:04 PM
b 4 i move on let me say thanks for ur help



on (release, keyPress "<Enter>") {
subscribe = "emailaddress";
getURL("subscribe@mydomainname.com", "_blank", "POST");

loadVariablesNum("http://www.mydomainname.com/cgi-bin/newsletter.asp", 0, "GET");
}


the value emailaddress will contain the email address of the subscribers.

please help me make the connection between getting the subcribers email info from the varialbe "subscribe"


thanks in advance

fgf
02-21-2003, 11:22 PM
on (release, keyPress "<Enter>") {
subscribe = "emailaddress";
getURL("subscribe@mydomainname.com", "_blank", "POST");

loadVariablesNum("http://www.mydomainname.com/cgi-bin/newsletter.asp", 0, "GET");
}

Subscribe will be set by having an input field with a variable called subscribe in it. It will be set by the user typeing in there email address and sent with any post or get sent from the same time line.

Thats not how you use get url to send variables "subscribe@mydomainname.com" should be the url of the script u want to target but you should only use get url if you want the page to refresh.

the easiest loadvariables syntax to use it
movieclip.loadvariables("http://www.mydomainname.com/cgi-bin/newsletter.asp", "GET"); the loadvariablesNum is only if you are mucking about with level which doesn't seem to be needed here

Your code should be more along the lines of

on (release, keyPress "<Enter>") {
this.loadVariables("http://www.mydomainname.com/cgi-bin/register.asp", "GET");
}

where register adds the users name to your database and passes back a variable called (for example) response, which is the name of a variable in a dynamic text field (which will change to display your message)

Login in to the newsletter (if its a webpage) would best be handled as a separate action. (which you can call after a successful register if you want)

fgf