ActionScript 3: Send GET/POST

by
ashardi
|

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);
}

Comments

outbound malang:
November 8, 2011 at 3:44 pm Reply

serunya outbound

 
kodok kampus:
November 28, 2011 at 6:14 pm Reply

mas aku masukno blogrol ben oleh backlink

 

Leave us a Comment

Put your name here:

Your email goes here:

Got a Website? Put it here (optional):

Your comment:

Ubuntu Oneiric Countdown!

Ubuntu 11.10 days to go