`

Flex4 FlashBuilder 4

    博客分类:
  • Flex
阅读更多
Adobe® Flash® Builder™ 4下载
地址:
http://www.adobe.com/go/try_flashbuilder
登陆后就可以选择到产品并可以进行下载。
第一个正式版本的程序:
<?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" creationComplete="application1_creationCompleteHandler(event)">
<!---HelloFlex4.mxml:power by 8765004.org@gmail.com:2010/3/23-->

<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
[Bindable]
private var ac:ArrayCollection=new ArrayCollection();
private var obj:Object=new Object();

protected function button1_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
if(label.text=="Hello World Flex4!")
  label.text="You Click me!";
else
  label.text="Hello World Flex4!";

}

protected function application1_creationCompleteHandler(event:FlexEvent):void
{
trace(arr[0],arr[1]);
obj={"hello":3,"world":31,"hi":5}// TODO Auto-generated method stub
ac.addItem(obj);
obj={"hello":113,"world":231,"hi":445};
ac.addItem(obj);
obj={"hello":113222,"world":23321,"hi":444445};
ac.addItem(obj);
obj={"hello":2,"world":23321,"hi":444445666};
ac.addItem(obj);
obj={"hello":113222,"world":231,"hi":44457};
ac.addItem(obj);
obj={"hello":113222,"world":23321,"hi":4444458};
ac.addItem(obj);
obj={"hello":113222,"world":23321,"hi":4444459};
ac.addItem(obj);
}

]]>
</fx:Script>

<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
<fx:Array id="arr">
<fx:String>hello</fx:String>
<fx:String>world</fx:String>
</fx:Array>
</fx:Declarations>
<s:Label  id="label" text="Hello World Flex4!"  x="300" y="200" height="50" fontSize="20"/>
<s:Button x="300" y="258" label="按钮" id="button1" click="button1_clickHandler(event)"/>
<mx:DataGrid id="list"   dataProvider="{ac}"  />
</s:Application>
(注:此文是8765004.org原创)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics