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"
相关文档:
commpent
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="initApp()" backgroundDisabledColor="#EEC6C6"
bord ......
一、
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
addedToStage="stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown)"
click="clickEvt(event)"
layout="absolute"
&nb ......
Repeater 顾名思义,Repeat就是重复的意思, Repeater 就是用来重复的控件
Repeater 会根据数据源中对象的多少来产生多少个子项,生成的子项全部是以数组形式存在的
<mx:Repeater id="myRepeater" dataProvider="{myArray}">
<mx:HBox>
  ......
http://blog.minidx.com/2008/08/06/1227.html good
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" verticalAlign="top"
horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" ......
uint int Number
Flex 四舍五入:
整数的四舍五入法,Math.round(一个Number类型的数)
小数的有 tofixed(uint) 方法
例如 var num:Number = 56.159;
num.tofixed(2); 它是个S ......