0 Replies Latest reply on Aug 30, 2007 2:50 PM by DCreedon

    ActionScript Error 2101 URL Encode Issue

    DCreedon
      Hiya,
      I am getting this message in Firefox 2.0.0.6 but not in IE7 or Opera 9.21

      Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
      at Error$/throwError()
      at flash.net::URLVariables/decode()
      at flash.net::URLVariables$iinit()
      at flash.net::URLLoader/flash.net:URLLoader::onComplete()

      I am calling a php script using the following, the script is being called successfully and creating entries in MySql but in Firefox I am getting a pop up window with the above message. I am not returning data from the php script (that I know of), just sending data to it.

      import flash.net.*;
      import mx.controls.Alert;
      import mx.collections.*;
      import mx.states.*;
      import flash.events.*;
      import flash.external.*;

      public function registerUser():void{
      var loader:URLLoader = new URLLoader();
      var params:URLVariables = new URLVariables(loader.data);


      params.firstName=firstName.text;
      params.lastName=lastName.text;
      params.email=email.text;
      params.password=password.text;
      params.country=country.text;
      params.add1=add1.text;
      params.add2=add2.text;
      params.add3=add3.text;
      params.postCode=postcode.text;


      var request:URLRequest = new URLRequest(" http://cms/mde/ajax/register.php");

      request.method = URLRequestMethod.POST;
      request.data = params;
      //Alert.show(request.data.email);



      loader.dataFormat=URLLoaderDataFormat.VARIABLES;

      try
      {
      loader.load(request);
      }
      catch (error:ArgumentError)
      {
      trace("An ArgumentError has occurred.");
      Alert.show("error");
      }
      catch (error:SecurityError)
      {
      trace("A SecurityError has occurred.");
      Alert.show("security error");
      }


      }


      Any ideas on this one?