Flex 4 DropDownList
Flex 4 DropDownList:
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Spark DropDownList control -->
<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">
<fx:Script>
<!--[CDATA[
import mx.collections.ArrayCollection;
import spark.events.IndexChangeEvent;
[Bindable]
public var myDP:ArrayCollection = new ArrayCollection(
[ {product:"Flex", price:100},
{product:"Air", price:200},
{product:"Catalyst", price:300},
{product:"FlashBuilder", price:400} ]);
private function updateSelection(e:IndexChangeEvent):void
{
currSel.text = "Current Product = " + myDDL.selectedItem.product;
currPrc.text = "Price = $" + myDDL.selectedItem.price;
}
]]>
</fx:Script>
<s:Panel width="75%" height="75%" title="My DropDownList Example"
horizontalCenter="0" verticalCenter="0">
<s:VGroup left="10" right="10" top="10" bottom="10">
<!-- Text components used to display current selection and price -->
<s:Label id="currSel" text="Current Product = -"/>
<s:Label id="currPrc" text="Price = $ -"/>
<!-- DropDownList will call the updateSelection function when the
selectionChanged event is dispatched -->
<s:DropDownList id="myDDL" prompt="Select One"
width="200" dataProvider="{myDP}"
labelField="product"
change="updateSelection(event);"/>
</s:VGroup>
</s:Panel>
</s:Application>
DropDownList 动态定位
从remote取回数据后,动态定位到
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Spark DropDownList control -->
<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"
相关文档:
flex控件对象、RemoteObject等都有一个共同的方法addEventListener。
addEventListener方法如下:
public function addEventListener(type:String, listener:Function,
useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
{
eventDispatcher.addEventListener(type, listener, us ......
原文地址:http://www.javaeye.com/topic/392836
关于Flex
Adobe Flex是一套创建富客户端应用(RIAs)的框架.Flex生成的swf文件可以直接运行在Flash Player之中。相比较基于时间轴的Flash开发,Flex框架更适合那些用传统方式开发应用程序的开发人员。Flex应用可以使用Flex builder来开发。这套IDE是基于Eclipse平台开发的。 ......
一、
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
addedToStage="stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown)"
click="clickEvt(event)"
layout="absolute"
&nb ......
原文地址:
http://www.gridlinked.info/how-to-encrypt-flex-rsls/
这里截取并尝试翻译了一段FLEX程序初始化及此解密过程.
应用启动过程:
1. 首先, 为第1帧加载足够的数据.
2. Flash Player通过创建SystemManager实例执行加载数据.
3. SystemManager命令Flash Player停止在第一帧.
4. SystemManager创建Preloader,
......
uint int Number
Flex 四舍五入:
整数的四舍五入法,Math.round(一个Number类型的数)
小数的有 tofixed(uint) 方法
例如 var num:Number = 56.159;
num.tofixed(2); 它是个S ......