<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="application1_creationCompleteHandler(event)" layout="absolute" width="1000" height="600" xmlns:aeon="aeon.*" xmlns:aswing="org.aswing.*" xmlns:local="*">
<mx:Style>
Application{
fontSize:12px;
}
</mx:Style>
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
import mx.events.PropertyChangeEvent;
import mx.utils.ObjectProxy;
private var sourceObject:Object = new Object();
[Bindable]
private var op1:ObjectProxy;
[Bindable]
private var op2:ObjectProxy;
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
this.sourceObject.name = "sourceObject";
this.sourceObject.status = "none";
op1 = new ObjectProxy(this.sourceObject,null,0);
op2 = new ObjectProxy(this.sourceObject,op1.uid);
}
protected function button1_clickHandler(event:MouseEvent):void
{
op1.status = "change";
trace(op2.status);
}
]]>
</mx:Script>
<mx:Button x="45" y="42" label="change" click="button1_clickHandler(event)"/>
<mx:Label x="217" y="48" text="{op1.status}"/>
<mx:Label x="217" y="76" text="{op2.status}"/>
</mx:Application>
测试ObjectProxy的用途,以及绑定
最新推荐文章于 2022-09-19 22:31:51 发布