문제

How can I get the content of a requested url, that returns an html-page, passed into a string, with java in flash actionscript. ?! I have this for now

var req:URLRequest = new URLRequest("http://somedomain.com/index.php");
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, handleVariables);
loader.load(req);

what do I have to write in the function handleVariables?!

도움이 되었습니까?

해결책

The URLLoader.data property will contain the decoded variables in the form of an Object. One way to retrieve them would be the following:

function handleVariables(event:Event):void {
    var loader:URLLoader = event.target as URLLoader;
    for (var key:String in loader.data)
        trace(key, loader.data[key]);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top