ActionScript3.0からサーバと変数をやりとりする
6 月 2nd, 2008
ActionScript3.0からサーバと変数をやりとりするときのメモ。
1 2 3 | var variables:URLVariables = new URLVariables(); variables.val1 = "hoge"; variables.val2 = "foo"; |
var request:URLRequest = new URLRequest(postUrl);
request.data = variables;
request.method = URLRequestMethod.POST;
var loader:URLLoader = new URLLoader();
loader.load(request);
URLVariablesのオブジェクトを作成してそこにどんどん変数とその値を追加していく感じ。
あとは普通にURLRequest.dataに格納したあと、URLLoader.load()に渡してあげればいい。
最近のコメント