0

This is my ActionScript3. If I clicked 'do4', I want to pass data to asp.net. But It is not working. I don't know why it is not working. please help me.

do4.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_9);

function fl_MouseClickHandler_9(event:MouseEvent):void
{
   var scriptRequest:URLRequest = new URLRequest("/Default.aspx");
   var scriptLoader:URLLoader = new URLLoader();
   var scriptVars:URLVariables = new URLVariables();

   scriptLoader.addEventListener(Event.COMPLETE,handleLoadSuccessful);
   scriptLoader.addEventListener(IOErrorEvent.IO_ERROR,handleLoadError);

   scriptVars.Location = "Incheon";

   scriptRequest.method = URLRequestMethod.POST;
   scriptRequest.data = scriptVars;

   scriptLoader.load(scriptRequest);

   function handleLoadSuccessful($evt:Event):void{
        trace("Message sent.");
   }
   function handleLoadError($evt:IOErrorEvent):void{
       trace($evt);
   }

}

This is code from asp.net. I have debugged many times. But I have no request about Location data. How do I get the data from flash?

 public partial class _Default : System.Web.UI.Page
 {
    protected void Page_Load(object sender, EventArgs e)
    {
        string str = Request.QueryString["Location"];
        System.Diagnostics.Debug.WriteLine(str);

    }
 }
  • 2
    If you're POSTing data (from ActionScript3 to ASP.Net page) you wont see the posted data in the Query String, see http://stackoverflow.com/questions/20151556/how-to-get-the-http-post-data-in-c and http://stackoverflow.com/questions/976613/get-post-data-in-c-asp-net – Jeremy Thompson Apr 12 '17 at 02:22
  • It could be that flash can not reach the aspx page or that the error is in your aspx. Have you checked if the aspx page could be loaded from swf ? Do you get this "Message sent" trace? You could check the request in your browser or in the server log files. – Philarmon Apr 12 '17 at 12:00
  • Please clarify, you have no logs from ASP and no trace messages from flash? In addition to COMPLETE and IO_ErrorEvent, you should also listen for SecurityErrorEvent on your AS3 URLLoader. – BadFeelingAboutThis Apr 12 '17 at 17:43

0 Answers0