您的位置:首页 > 其它

Flex 学习笔记

2009-01-15 17:23 225 查看
学习Flex第一堂课,学习了Glow,Blur,Move,Parallel和DataGrid标签的使用,以及简单的事件。贴了代码过来,其实也是从网上找来的例子,自己跟着做了做,然后找找了在线文档,了解了这几个标签的简单用法,以后继续。

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[

import mx.collections.ArrayCollection;
public function inputName():void{
nameLabel.text = nameText.text;
}
//DataGrid的数据源
[Bindable]
private var medalsAC:ArrayCollection = new ArrayCollection( [
{ Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
{ Country: "China", Gold: 32, Silver:17, Bronze: 14 },
{ Country: "Russia", Gold: 27, Silver:27, Bronze: 38 } ]);
]]>
</mx:Script>

<!--
The Parallel effect plays multiple child effects at the same time.
-->
<mx:Parallel id="blurMoveShow" target="{nameLabel}">
<!--The Glow effect lets you apply a visual glow effect to a component.
If you apply a Glow effect to a component,
you cannot apply a GlowFilter or a second Glow effect to the component.
-->
<mx:Glow id="buttonGlow" color="0x99ff00" alphaFrom="1.0" alphaTo="0.3" duration="1500"/>
<!--alphaFrom:Starting transparency level between 0.0 and 1.0, where 0.0 means transparent and 1.0 means fully opaque -->
<!--alphaTo:Ending transparency level between 0.0 and 1.0, where 0.0 means transparent and 1.0 means fully opaque -->

<!--The Blur effect lets you apply a blur visual effect to a component.
If you apply a Blur effect to a component,
you cannot apply a BlurFilter or a second Blur effect to the component.
-->
<mx:Blur id="numberBlur" blurXFrom="10.0" blurXTo="0.0" blurYFrom="10.0" blurYTo="0.0" duration="2000"/>
<!--blurXFrom:The starting amount of horizontal blur. Valid values are from 0.0 to 255.0 -->

<mx:Move id="numberMove" yBy="20" duration="2000"/>
</mx:Parallel>

<mx:Panel height="489" width="542" layout="absolute" x="10">
<mx:Label id="nameLabel" x="264" y="21" text="4 8 15 16 23 42" width="166" visible="false"/>
<mx:TextArea id="nameText" text="Text" width="150" keyUp="inputName()" x="10" y="10"/>
<mx:Button label="View" id="button" click="blurMoveShow.play();numberBlur.play();nameLabel.visible=true" mouseUpEffect="{buttonGlow}" x="187" y="19"/>

<mx:DataGrid dragEnabled="true" dataProvider="{medalsAC}" x="10" y="113">
<mx:columns>
<mx:DataGridColumn dataField="Country" />
<mx:DataGridColumn dataField="Gold" />
<mx:DataGridColumn dataField="Silver" />
<mx:DataGridColumn dataField="Bronze" />
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Application>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: