flex day 3-html和window组件
来源:互联网 发布:江西安全知识网络答题 编辑:程序博客网 时间:2024/05/16 07:58
air的html组件,但是html的显示出来怪怪的
<s:layout><s:VerticalLayout/></s:layout><mx:ControlBar width="100%"><s:Button label="<Back" click="content.historyBack();"/><mx:Button label="Forward >" click="content.historyForward();"/><mx:TextInput id="address" text="{content.location}" width="100%"/><mx:Button label="GO" click="content.location = address.text"/></mx:ControlBar><mx:Canvas width="100%" height="100%"><mx:HTML id="content" location="http://www.163.com" /></mx:Canvas>
接着就是window组件了。window组件很是神奇,其实就是打开一个新的窗口。
但是解决了我昨天的一个疑问,我想调用的另外一个B.mxml,我把那个B.mxml做成一个组件,
基于mx.core.Window,这样就能调用了,当作是一个window打开就是了。然后给newWindow
增加事件监听,这样可以在打开新窗口的时候隐藏旧窗口
<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" applicationComplete="placeWindow()"><fx:Declarations><!-- 将非可视元素(例如服务、值对象)放在此处 --></fx:Declarations><fx:Script><![CDATA[import mx.controls.Alert;import mx.events.AIREvent;import spark.components.Window;private function placeWindow():void{this.nativeWindow.x = 200;this.nativeWindow.y = 200;}private function onCloseWindow():void{Alert.show("close window");}private function newWindow():void{var newWindow:Window = new myWindowCompnent;//newWindow.systemChrome = NativeWindowSystemChrome.NONE;//newWindow.transparent = true;newWindow.title = "new WINDOW";newWindow.width = 400;newWindow.height = 400;newWindow.open(true);newWindow.alpha = .9;newWindow.addEventListener(Event.CLOSING,showWindow);}private function hideWindow():void{this.nativeWindow.visible = false;}private function showWindow(evt:Event):void{this.nativeWindow.visible = true;}]]></fx:Script><mx:Label text="HI My Friend" horizontalCenter="0" verticalCenter="0"/><s:Button label="new window" click="newWindow()" mouseDown="hideWindow()"/></s:WindowedApplication>
另myWindowCompnent的码是基于filesystem的
<s:Window 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="400" height="300"><fx:Declarations><!-- 将非可视元素(例如服务、值对象)放在此处 --></fx:Declarations><mx:HDividedBox><mx:FileSystemTree id="tree" width="200" height="100%" direction="{new File('c:\\')}" enumerationMode="directoriesOnly" change="dataGrid.directory = File(tree.selectedItem);"/><mx:FileSystemDataGrid id="dataGrid" width="100%" height="100%" directory="{new File('c:\\')}"/></mx:HDividedBox></s:Window>
0 0
- flex day 3-html和window组件
- flex:Flex 组件的定位和布局
- 自定义FLEX组件(3)
- flex项目和组件等
- flex组件和样式网址
- flex 组件 和 样式 一览表
- HTML表单和组件
- Flex学习笔记3——组件和容器
- flex嵌入html和jsp
- Flex 3 功能预览(3): flex组件和SDK的改进
- flex嵌入到html和html嵌入到flex
- flex day 5 air的drag和drop
- flex 3扩展自定义组件
- flex day 1
- Flex组件IFrame中嵌入HTML页面的方法
- Flex组件篇:HSlider和VSlider
- Flex组件篇:HRule和VRule
- [Flex 2] 04 容器和组件
- CAP原则
- IPv6的思科培训启用SSH在Cisco IPv6路由器
- Ubuntu 12.04安装putty
- IPv6的思科培训使用ariance(EIGRP)命令
- 测试人员的产品观念
- flex day 3-html和window组件
- iPhone应用程序推出了市场苹果iOS 4功能
- PHP生成二维码
- 移动硬盘文件丢失如何找回?
- swift学习第七天 ?和!
- 白蚁和害虫外资在上升
- silverlight与webapi 通讯的辅助对象
- 济南美女为什么不怎么好看呢
- hbase的缓存cacheblock