- <?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)">
- <s:layout>
- <s:BasicLayout/>
- </s:layout>
- <fx:Script>
- <!--[CDATA[
- import com.firemax.controls.FireMaxAlert;
-
- import mx.collections.ArrayCollection;
- import mx.events.FlexEvent;
-
- [Bindable]
- public var listDemo:ArrayCollection;
-
- var stringName:String = new String("李四");
-
- protected function application1_creationCompleteHandler(event:FlexEvent):void
- {
-
- listDemo=new ArrayCollection();
-
- listDemo.addItem(new String("张三"));
- listDemo.addItem(stringName);
- listDemo.addItem(new String("王五"));
-
-
- }
-
- protected function button1_clickHandler(event:MouseEvent):void
- {
-
- stringName="麻子";
- FireMaxAlert.show(listDemo.getItemAt(1).toString());
-
- }
- ]]-->
- </fx:Script>
- <fx:Declarations>
- <!-- 将非可视元素(例如服务、值对象)放在此处 -->
- </fx:Declarations>
- <mx:DataGrid x="46" y="33" width="403" height="212" dataProvider="{listDemo}">
- <mx:columns>
- <mx:DataGridColumn headerText="列 1" dataField="col1"/>
- </mx:columns>
- </mx:DataGrid>
- <s:Button x="46" y="275" label="按钮" click="button1_clickHandler(event)"/>
- </s:Application>
posted @
2012-02-18 14:02
张良
阅读(
310)
评论()
编辑
收藏
举报