發表文章

目前顯示的是有「Flex」標籤的文章

Rotten Tomatoes API And Tour De Flex application For Flex 開發須知

圖片
使用Rotten Tomatoes API  For Flex 開發環境部屬需要前往官方網站申請API KEY即可使用 Rotten Tomatoes 官方網站 http://developer.rottentomatoes.com/ Tour De Flex application 這是一個許多  FOR FLEX 應用開發參考範例的 APP,對於開發者來說是一個很大的幫助 http://www.adobe.com/devnet/flex/tourdeflex.html

Flex4.6_建立一個簡易留言板範例使用AS3與MXML溝通範例

圖片
首先建立一個新的Package 名為 com.pomodo.model 之後在底下建立 Task.as 作為 mxml的溝通管道 package com.pomodo.model { public class Task { [Bindable] public var name:String; public function Task(name:String=""){ this.name=name; } } } 資料結構如下: 新增一個 mxml 名為 guestbook <?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"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ import com.pomodo.model.Task; import mx.collections.ArrayCollection; [Bindable] private var tasks:ArrayCollection=new ArrayCollection(); private function createTask(...

Flex4.6_使用AS3與MXML進行數據綁定溝通範例

圖片
建立.as檔案名為 Task_03 package { public class Task_03 { [Bindable] public var name:String; public function Task_03(name:String="") { this.name=name; } } } name 變數的Bindable確保該變數可以做為數據綁定的來源!! 建立MXML 檔案 <?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"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ [Bindalbe] private var _task:Task_03=new Task_03("Learn Binding"); ]]> </fx:Script> <s:layout> <s:VerticalLayout paddingLeft="5" paddingTop="5"/> </s:layout> <s:TextInput id="te...

Flex4.6_單向與雙向數據綁定使用Label與TextInput範例

圖片
<?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"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:layout> <s:VerticalLayout paddingLeft="5" paddingTop="5"/> </s:layout> <s:TextInput id="textInput1" text="{textInput2.text}" x="191" y="174"/> <s:TextInput id="textInput2" text="{textInput1.text}" x="191" y="248"/> <s:Label x="190" y="341" text="# chars:{textInput1.text.length}"/> </s:Application> 每個TextInput組件的text屬性都被綁定使用 ({}語法) 到另一個TextInput 組件的text屬性上...

FLEX4_Label與Button建立Click 事件判斷範例

圖片
<?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"   initialize="init()"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <fx:Script> <![CDATA[ private function init():void{ button3.addEventListener(MouseEvent.CLICK , handleClick); } private function handleClick(event:MouseEvent):void{ if(event.target==button2){ label.text+='Button 2 clicked\n'; } else if(event.target==button3){ label.text+='Button 3 clicked\n'; } } ]]> </fx:Script> <s:VGroup x="0" y="0" width="100%"> <s:Button id="but...

FLEX4_在Design上方新增controlBarContent專屬區域範例

圖片
<?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"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:controlBarLayout> <s:BasicLayout/> </s:controlBarLayout> <s:controlBarContent> <s:Button label="Menu"/> </s:controlBarContent> </s:Application> 執行結果:

FLEX4_group容器底下新增垂直button可捲軸範例

圖片
<?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"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:Scroller x="463" y="102" width="105" height="113">//新增捲軸 <s:Group  x="512" y="298" width="105" height="102"> <s:layout> <s:VerticalLayout/>//垂直顯示 </s:layout> <s:Button x="116" y="47" label="1號"/> <s:Button x="216" y="47" label="2號"/> <s:Button x="316" y="47" label="3號"/> <s:Button x="416" y...