1. PopUpWindow
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ [Bindable] private var title:String = "PopUpAnchor"; [Bindable] private var message:String = "Click Me"; private function openPopUpButton():void { panelPopUp.displayPopUp = true; } private function closePopUpButton():void { panelPopUp.displayPopUp = false; } ]]> </fx:Script> <s:Button label="Click Me" click="openPopUpButton();"/> <s:PopUpAnchor id="panelPopUp"> <!-- mouseDownOutside event enables close popup window when we click outside the popup window --> <s:Panel title="{title}" mouseDownOutside="closePopUpButton();"> <s:Button id="closeButton" click="closePopUpButton();" label="{message}"/> </s:Panel> </s:PopUpAnchor> </s:Application>
2. Scrollable container
1) Scorller can only contain one scrollable component that implments the IViewport interface.
2) s:VGroup implements IViewport inteface.
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:Scroller verticalScrollPolicy="on"> <s:VGroup height="100"> <s:Button label="Hello"/> <s:Button label="Hello"/> <s:Button label="Hello"/> <s:Button label="Hello"/> <s:Button label="Hello"/> <s:Button label="Hello"/> <s:Button label="Hello"/> <s:Button label="Hello"/> <s:Button label="Hello"/> <s:Button label="Hello"/> </s:VGroup> </s:Scroller> </s:Application>
3. Radio buttons
1) Using simple group
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ import mx.controls.Alert; private function radioChangeHandler(e:Event):void { Alert.show(e.target.label); } ]]> </fx:Script> <s:VGroup> <s:RadioButton label="Cairngorm" groupName="microarchitecture" change="radioChangeHandler(event)"/> <s:RadioButton label="PureMVC" groupName="microarchitecture" change="radioChangeHandler(event)"/> <s:RadioButton label="Robotlegs" groupName="microarchitecture" change="radioChangeHandler(event)"/> <s:RadioButton label="Mate" groupName="microarchitecture" change="radioChangeHandler(event)"/> <s:RadioButton label="Parsley" groupName="microarchitecture" change="radioChangeHandler(event)"/> </s:VGroup> </s:Application>
2) Using RadioButtonGroup
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> <s:RadioButtonGroup id="codeStyleRadioGroup" change="groupChangeHandler(event)"/> </fx:Declarations> <fx:Script> <![CDATA[ import mx.controls.Alert; private function groupChangeHandler(e:Event):void { // The result of the two alerts is the same! Alert.show((codeStyleRadioGroup.selection as RadioButton).label); Alert.show(codeStyleRadioGroup.selectedValue as String); } ]]> </fx:Script> <s:VGroup> <s:RadioButton label="pirate" group="{codeStyleRadioGroup}"/> <s:RadioButton label="ninja" group="{codeStyleRadioGroup}"/> </s:VGroup> </s:Application>
4. Submit a Flex-Form to a Server Side Script
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ private function submit(e:Event):void { // Set the request params var variables:URLVariables = new URLVariables(); variables.username = nameText.text; variables.password = passText.text; // Wrap the request params in request and send the request var url:String = "http://mockup.com/script.php"; var request:URLRequest = new URLRequest(url); request.data = variables; request.method = URLRequestMethod.POST; sendToURL(request); } ]]> </fx:Script> <s:VGroup> <s:Form> <s:FormItem label="Username"> <s:TextInput id="nameText"/> </s:FormItem> <s:FormItem label="Password"> <s:TextInput id="passText"/> </s:FormItem> </s:Form> <s:Button label="Submit" click="submit(event)"/> </s:VGroup> </s:Application>
相关推荐
《ShaderX2 - Introductions and Tutorials with DirectX9》是一部深入探讨DirectX9着色器技术的专业文献,旨在引导读者理解和掌握DirectX9中的着色语言和编程技巧。本书结合了理论与实践,通过一系列的教程,为读者...
### ShaderX2: Introductions & Tutorials with DirectX 9 #### 一、书籍概述 《ShaderX2: Introductions & Tutorials with DirectX 9》是一本专注于介绍和教授DirectX 9环境下着色器编程的基础教程。本书由...
Sean Kane and Karl Matthias have added a complete chapter on Docker Compose, deeper coverage of Docker Swarm mode, introductions to both Kubernetes and AWS Fargate, examples on how to optimize your ...
This idea led to two books: ShaderX2: Introductions & Tutorials with DirectX 9 ShaderX2: Shader Programming Tips & Tricks with DirectX 9 The first book helps the reader get started with ...
This idea led to two books: ShaderX2: Introductions & Tutorials with DirectX 9 ShaderX2: Shader Programming Tips & Tricks with DirectX 9 The first book helps the reader get started with ...
Essentially three books in one: provides thorough introductions to the PHP language and the MySQL database, and shows you how these two technologies can be effectively integrated to build powerful ...
《ShaderX2: Introductions and Tutorials with DirectX 9.0》是一本专注于ShaderX编程技术的图书,其首次出版于2003年8月25日。这本书的内容着重于游戏开发中的一种重要技能——着色器编程。着色器是图形处理单元...
本资源提供了陕旅版小学英语词汇表,涵盖了从 Unit 1 到 Unit 8 的英语单词和短语,总共包括了数十个单元的词汇和短语,涵盖了Greetings、Introductions、Food、Animals、Family、Transportation、Body Parts 等多个...
Kromann draws upon more than 20 years of experience working with these technologies to pack this book with practical examples and insight into the real-world challenges faced by developers....
文档中 introductions 了硬件连接部分,包括单片机、液晶显示屏、蜂鸣器、DS1302时钟芯片等的连接方式。例如,P2^1脚连接液晶显示屏的EN信号线,P2^0脚连接液晶显示屏的WS信号线,P1^0脚连接DS18B20温度传感器的信号...
Proven techniques for optimizing web, file, print, database, and application servers Practical introductions to open source performance management tools Easy-to-understand examples based on Red Hat ...
### DirectX 9 Introductions and Tutorials #### 概述 《ShaderX2:DirectX 9 的介绍与教程》是一本由 Wolfgang F. Engel 编辑的专业书籍,主要聚焦于 DirectX 9 的使用与高级图形编程技术。本书不仅为初学者提供...
这个“Introductions_and_Tutorials_with_DirectX_9_code”源代码集合可能是由一系列教程或示例程序组成的,旨在帮助初学者和有经验的开发者更好地理解和应用DirectX 9技术。 在这些压缩包的子文件中,我们看到了以...
#### Lesson 25: Modeling a Simple Continuous System Based on MATLAB - **MATLAB建模**:这部分内容介绍了如何使用MATLAB软件来建立简单的连续系统的模型,并进行仿真分析。MATLAB是一种强大的数值计算工具,广泛...
三年级上册英语单元达标测评卷-Module 2 Introductions_13-14外研版(三起)扫描版.doc
Essentially three books in one, readers not only profit from extensive introductions to the core features of each technology, but also learn how to effectively integrate the two in order to build ...
Essentially three books in one, readers not only profit from extensive introductions to the core features of each technology, but also learn how to effectively integrate the two in order to build ...