如何得到一个网页的输出在ActionScript 3 [英] How to get output of a webpage in ActionScript 3

查看:166
本文介绍了如何得到一个网页的输出在ActionScript 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们说这个页

www.example.com/mypage

返回一些HTML,我想在ActionScript来解析。

returns some html that I want to parse in Actionscript.

我如何从ActionScript调用此页时会取回一个字符串变量的反应?

How do i call this page from Actionscript while getting back the response in a string variable?

推荐答案

试试这个:

import flash.net.*

var _loader:URLLoader = new URLLoader();
var _req:URLRequest = new URLRequest('http://www.google.com');
_loader.addEventListener(Event.COMPLETE, _onComplete);
_loader.load(_req);

function _onComplete(e:Event):void{
    trace(String(_loader.data));
}

这篇关于如何得到一个网页的输出在ActionScript 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆