您的位置:首页 > Web前端 > HTML

AIR实例教程HTMLLoader

2008-05-04 20:51 429 查看
点击下载查看程序

代码:

<?xml version="1.0" encoding="utf-8"?>

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"

creationComplete="init();"

layout="absolute" width="1024" height="768">

<mx:Script>

<![CDATA[

// imports

import flash.html.HTMLLoader;

import flash.net.URLRequest;

import mx.core.UIComponent;

// called on creationComplete

public function init():void

{

var htmlLoader:HTMLLoader = new HTMLLoader();

var urlReq:URLRequest = new URLRequest("http://www.novologic.com");

// HTMLLoader Class size defaults to 0,0 so you must size it.

htmlLoader.width = 1024;

htmlLoader.height = 768;

// load URLRequest

htmlLoader.load(urlReq);

// Create UIComponent to add html object to

var myComponent:UIComponent = new UIComponent();

myComponent.addChild(htmlLoader);

// now add component to stage

this.addChild(myComponent);

}

]]>

</mx:Script>

</mx:WindowedApplication>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: