Passing Variables to ASPX to the URL String from AS3 - Message Failed
Im freaking out! Im trying to send three variables (fname, lname, and email) to append them to the URL string like this http://www.whatever.com?address=&firstname=&lastname=&email= , but it traced as "Message Failed" I wondered what I did wrong with this code.
in Flash 'fname_txt', 'lname_txt', and 'email_txt' are the instance names of the Input Text

import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
mcButton.addEventListener(MouseEvent.MOUSE_UP, onClick);
function onClick(e:MouseEvent😞void {
var scriptRequest:URLRequest = new URLRequest("../index.aspx");
var scriptLoader:URLLoader = new URLLoader();
var scriptVars:URLVariables = new URLVariables();
scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful);
scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError);
scriptVars.fname = fname_txt.text;
scriptVars.lname = lname_txt.text;
scriptVars.email = mail_txt.text;
scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;
scriptLoader.load(scriptRequest);
function handleLoadSuccessful($evt:Event😞void
{
trace("Message sent.");
}
function handleLoadError($evt:IOErrorEvent😞void
{
trace("Message failed.");
}
fname_txt.text = "";
lname_txt.text = "";
email_txt.text = "";
}
