Skip navigation
Currently Being Moderated

as3 functionality in as2

Mar 1, 2012 3:56 PM

This is more of an as2 questions, but did not seem a section for that, so sorry if this is the wrong place.  

 

I am working with a template that is built in as2, and when a button is clicked, a new browser window opens to a specified url and some info is passed to the php file.   I already have this funcinality via as3 in another site, but my director wants it in this onld as2 template.

 

here is my as3 Code:

 

//Path to PHP File
var serverFile:String = "https://www.mypath.net/myphpfile.php";
  
//Instantiate a new URLVariables Object
var postVariables:URLVariables = new URLVariables();
  
//add custom variables
postVariables.GuestUserKey = 'myKeyInfo';
  
//Request the URL
var urlRequest:URLRequest = new URLRequest(serverFile);
  
//Assign data to URL
urlRequest.data = postVariables;
  
//Tell flash what method to send Data
urlRequest.method = URLRequestMethod.POST;
  
try
     {
          //Open new page and pass URL and Varaiables.
          navigateToURL(urlRequest);
     }
catch (event:Error)
     {
          trace(this + (event));
     }

 

I need to achive this funcinality with as2 and here is what i have tried, but does not seem to work.

 

on (release) {
    var myLoadVar:LoadVars = new LoadVars;
    myLoadVar.GuestUserKey = 'myKeyInfo';
    myVars.send("https://www.mypath.net/myphpfile.php", myLoadVar, 'POST');
}

 

 

also, I have no control over the php file

 

thanks.

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points