ActionScript 3: Send GET/POST

Filed Under (Digital Ant) by ashardi on 24-09-2011

At the office, we recently developing some digital signage products, which requiring ActionScript to take part. So, here is a little code snippet of how to send GET/POST variables from AS3:

import flash.net.*;
var url:String = "http://192.168.1.1:1234/";
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.GET;

var variables:URLVariables = new URLVariables();
variables.name = "Anton Ashardi";
request.data = variables;

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.load(request);

function onComplete (event:Event):void {
trace(event.target.data);
}
more...

Comments

  1. serunya outbound

  2. mas aku masukno blogrol ben oleh backlink

Post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>