2010-12-11 3 views
1
var lv = new LoadVars(); 
    var r = new LoadVars(); 
    lv.action = "update"; 
      r.onLoad = function(success) 
    { 
       //do further logic here 
      } 
    lv.sendAndLoad("http://example.net/service.php", r, "POST"); 

플렉스 3에서 위의 작업을 수행하는 방법은 무엇입니까?flex3의 LoadVars에 해당하는 기능은 무엇입니까?

UPDATE

어떻게 URLLoader와 함께 할 수 있습니다? HTTPService를 함께

답변

3

var vo:Object = new Object; 
    vo.action = "update"; 
    s = new HTTPService(); 
    s.url = "http://example.net/service.php" 
    s.method = "POST"; 
    s.resultFormat = "e4x"; //or xml or whatever 
    s.send(vo); 
    s.addEventListener(ResultEvent.RESULT,onLoad); 

은 URLLoader 함께

var loader:URLLoader = new URLLoader(); 
var request:URLRequest = new URLRequest("url here"); 
var vars:URLVariables = new URLVariables();  
vars.action = "update"; 
request.data = vars; 
request.method = URLRequestMethod.POST; 
loader.load(request); 
loader.addEventListener(Event.COMPLETE,onComplete); 
+0

당신은 MXML에서 원하십니까? – chchrist

+0

URLLoader로 어떻게 할 수 있습니까? – fms

관련 문제