Add the Bindable metatag to your function and specify an event to be associated with it's update.
通过事件控制属性只读 package com.example.package { import flash.events.Event; import flash.events.EventDispatcher; import mx.collections.ArrayCollection; public class ClassNameextends EventDispatcher { private var _myExposedVar:ArrayCollection; public function ClassName() { } public function set resultsObject(value:Object):void { /* Do Stuff with resultsObject and update _myExposedVar */ this.dispatchEvent(new Event("ResultsUpdated") ); } [Bindable(event="ResultsUpdated")] public function get myExposedVar ():ArrayCollection { return this._myExposedVar; } }}通过赋值时发送事件,和捕捉事件,来控制属性只读。赋值即变成取值。
转载于:https://www.cnblogs.com/wuhenke/archive/2009/10/31/1593588.html