Asv3's Blog

April 28, 2010

Simple Form Submit in AS3

Filed under: actionscript, as3, flash — asv3 @ 6:04 pm

Here is the code one of my friend asked, he wanted flash to submit some data on click of a button. This script assumes you have a Movieclip with instance name “but1” on stage.

but1.addEventListener("click",submitContact);

function submitContact(e:Event) {
var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new URLRequest("email.php");
var varLoader:URLLoader = new URLLoader;
varSend.method = URLRequestMethod.GET;
varSend.data = variables;
variables.Name="Ravi";
variables.Email="Ravi@Some.com";
varLoader.load(varSend)
}

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.