Ok - I’m getting really close here… I have some as3 script passing variables to an asp script which writes a text file for me.
Here’s the AS3:
stop();
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new URLRequest("test.asp");
var varLoader:URLLoader = new URLLoader();
variables.testName = "Bob";
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
t.buttonMode = true;
t.addEventListener(MouseEvent.CLICK, iii);
function iii(e:MouseEvent):void {
varLoader.load(varSend);
}
Here’s the ASP:
<html>
<body>
<%
testvar = Request.QueryString("testName")
Set fs = CreateObject("Scripting.FileSystemObject")
Set wfile = fs.CreateTextFile(Server.MapPath("myfile.txt"))
wfile.Write ("myReply " + testvar)
wfile.close
Set wfile=nothing
Set fs=nothing
%>
</body>
</html>
The output I get in the file right now is “myReply”… in other words, the variable is either not passing in correctly, or I am not retrieving it in the ASP code correclty.
Any ideas?