<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="800" height="600" minWidth="200"
creationComplete="onCreationComplete(event)" showStatusBar="false" keyUp="keyUp(event)" title="air web browser"> <fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent; protected function onCreationComplete(event:FlexEvent):void
{
html.location = 'http://www.baidu.com';
html.addEventListener(LocationChangeEvent.LOCATION_CHANGING,onLocationChanging);
txtUrl.setFocus();
} private function keyUp(e:KeyboardEvent):void { if(e.keyCode == 9){//tap }else if(e.keyCode == 13){//Enter }
} private function stateChange(target:Object):void {
var url:String = target.text;
if (url.indexOf('http://') == -1 && url.indexOf('https://') == -1) {
url = 'http://' + url;
}
html.location = url;
}
private function onLocationChanging(e:LocationChangeEvent):void
{
txtUrl.text = e.location;
}
        ]]>
</fx:Script> <s:HGroup left="10" y="10" right="10" width="100%" >
<s:TextInput id="txtUrl" x="10" width="100%" keyUp="keyUp(event)">
</s:TextInput>
<s:Button id="btnGo" y="10" width="65" label="Go" click="html.location = txtUrl.text" />
</s:HGroup>
<mx:HTML id="html" bottom="5" top="40" right="10" left="10" locationChange="txtUrl.text = html.location" /> </s:WindowedApplication>

[flex] as3.0 实现基于air的简单浏览器的更多相关文章

  1. FLEX AS3.0 百度地图

    window xp系统 FlashBuilder4.5 先上百度下载flash api 下载地址http://developer.baidu.com/map/flash.htm 新建一个flex项目 ...

  2. [Flash&Flex] AS3.0 如何利用[Embed(source="...")]嵌入资源

    在flex和flashIDE中我们可以[Embed(source="...")]嵌入图片和swf等资源,但两者之间的嵌入方式又有所区别. flex示例: [Embed(source ...

  3. [转]Flash、Flex、AS3.0框架及类库资源收集之十全大补

    原文地址:http://www.d5power.com/portal.php?mod=view&aid=27 APIs.Libs.Components1.as3ebaylibhttp://co ...

  4. Actionscript,AS3,MXML,Flex,Flex Builder,Flash Builder,Flash,AIR,Flash Player之关系

    转自zrong's blog:http://zengrong.net/post/1295.htm ActionScript ActionScript通常简称为AS,它是Flash平台的语言.AS编写的 ...

  5. as3.0 Flex 图像处理

    as3.0 Flex 图像处理 已知的一些图像处理,主要是得到颜色过滤矩阵,不完整,大家一起来补充. //颜色转换数组,所有的0都是可调值public var colorArray:Array = [ ...

  6. “AS3.0高级动画编程”学习:第一章高级碰撞检测

    AdvancED ActionScript 3.0 Animation 是Keith Peters大师继"Make Things Move"之后的又一力作,网上已经有中文翻译版本了 ...

  7. flex+AS3编程规范

    flex+AS3编程规范 Flex+AS3编码规范 http://www.cnblogs.com/jiahuafu/   1.  缩写: 尽量避免使用缩写,使用缩写时尽量和Flex保持一致.但要记住一 ...

  8. “AS3.0高级动画编程”学习:第二章转向行为(下)

    在上一篇里,我们学习了“自主角色”的一些基本行为:寻找(seek).避开(flee).到达(arrive).追捕(pursue).躲避(evade).漫游(wander).这一篇将继续学习其它更复杂, ...

  9. “AS3.0高级动画编程”学习:第二章转向行为(上)

    因为这一章的内容基本上都是涉及向量的,先来一个2D向量类:Vector2D.as (再次强烈建议不熟悉向量运算的童鞋,先回去恶补一下高等数学-07章空间解释几何与向量代数.pdf) 原作者:菩提树下的 ...

随机推荐

  1. Frequently Used Shell Commands

    [Common Use Shell Commands] 1.ps aux:查看当前所有进程 ,以用户名为主键.可以查看到 USER.PID.COMMAND(binary所有位置) 2.netstat ...

  2. cookie的长度和限制数量

    一.浏览器允许每个域名所包含的 cookie 数 Microsoft 指出 Internet Explorer 8 增加 cookie 限制为每个域名 50 个,但 IE7 似乎也允许每个域名 50 ...

  3. 自学jquery,下午实现前后台交互--成为牛逼的女程序员

    希望周末能够把搜索质量对比的页面做出来!!! 牛逼的薰衣草程序员,fighting

  4. 16.3Sum Closest (Two-Pointers)

    Given an array S of n integers, find three integers in S such that the sum is closest to a given num ...

  5. 滑动窗口的中位数 · Sliding Window Median

    [抄题]: 给定一个包含 n 个整数的数组,和一个大小为 k 的滑动窗口,从左到右在数组中滑动这个窗口,找到数组中每个窗口内的中位数.(如果数组个数是偶数,则在该窗口排序数字后,返回第 N/2 个数字 ...

  6. 去掉redhat linux提示注册

    去掉提示注册的话,卸载几个软件包:#rpm -qa | grep subscription-manager 然后移除那出现的几项吧:#yum remove subscription-manager-g ...

  7. python 开发简单的聊天工具-乾颐堂

    python 太强大了,以至于它什么都可以做,哈哈,开个玩笑.但是今天要讲的真的是一个非常神奇的应用. 使用python写一个聊天工具 其实大家平时用的QQ类似的聊天工具,也是使用socket进行聊天 ...

  8. 10个实用的UX设计作品推销小窍门

    以下内容由Mockplus(摹客)团队翻译整理,仅供学习交流,Mockplus是更快更简单的原型设计工具. 众所周知,产品用户体验很重要,即使是Google也知道这一点.但是,当真正涉及到UX 设计销 ...

  9. docker-compose up启动又停止,需要加tty为true

    如果docker-compose.yml如下,则用docker-compose up -d启动起来的容器可能会立即停止. version: '2' services: mir-http-repo: i ...

  10. windows环境下配置tornado

    1.前言        在网上看过一些在windows下配置tornado的教程,有一些写的十分复杂,让人望而生却.然后我就自己试着在windows下面配置tornado.我发现,方法非常简单,短短几 ...