I see this example here: http://damn.ihateblue.net/2011/09/24/actionscript-3-send-getpost/
Which looks pretty good. But the loader seems overly complicated. What if I don't need to listen for a response? Can this be simplified?
If you don't want to listen for a response then you can remove the dataFormat, the listener and its handler function. You can also leave out the request.method
because GET is the default.
import flash.net.*;
var url:String = "http://192.168.1.1:1234/";
var request:URLRequest = new URLRequest(url);
var variables:URLVariables = new URLVariables();
variables.name = "Anton Ashardi";
request.data = variables;
var loader:URLLoader = new URLLoader();
loader.load(request);
If you don't want to send any data along with your request you can also omit the central code block.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With