2013年5月26日 星期日

Flex Note 1

tags:
<s:  spark

add class instance: use mxml component

event type: bubbles,cancelable,currentTarget,eventPhase,Target,Type

Interface:
package oreilly.cookbook {
public interface IDataInterface {
function set dataType(value:Object):void;
function get dataType():Object;
function update():Boolean;
function write():Boolean;
function readData():Object;
}
}

public class ClientData extends EventDispatcher implements IDataInterface {

Interface in XML:
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
width="400" height="300" implements= "IDataInterface">

Containers : MX, Spark

Group: addElement, removeElement, swapElement

binding: event-based: sync event to objects that are affected
binding: for pass data [Bindable] public var aaa;
Class with binding: must implement IEventDispatcher

bind in MXML: {} or <fx:Binding>
<fx:Binding source="nameInput.text" destination="nameOutput.text" />

bind function:<s:RichText text="{function(arg.text )}" />

in actionscript :Use the mx.utils.binding.BindingUtils class to create mx.utils.binding.Change
Watcher objects.

custom bind
[Bindable(event="fnChanged")]


Browser: navigateToURL( new URLRequest( newUrl.text ),
target.selectedItem as String );
<mx:TextInput id="newUrl"
top="10" left="10" right="10"
text="http://www.oreilly.com/" />
<mx:ComboBox id="target"
top="40" left="10"
dataProvider="{ [ '_blank', '_self' ] }" />

use flashvars into <embed> tag

AS call javascript: ExternalInterface.call("JSFunc");

change html title: BrowserManager.setTitle();
ParseURL: URLUtil

Data from URL into Flex control: BrowserManager.addEventListener(BrowserChangeEvent.BROWSER_URL_CHANGE, func);

control visible contents of Flex by URL param

沒有留言:

張貼留言