欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

如何定義一個(gè)getter和seter設(shè)置的屬性可以被綁定

 更新時(shí)間:2009年05月25日 18:43:12   作者:  
Define private variable for maxFontSize.
// Define private variable for maxFontSize.
public var _maxFontSize:Number = 15;
// Define public getter method, mark the property
// as usable for the source of data binding,
// and specify the name of the binding event.
[Bindable("maxFontSizeChanged")]
public function get maxFontSize():Number {
return _maxFontSize;
}
// Define public setter method.
public function set maxFontSize(value:Number):void {
if (value <= 30) {
_maxFontSize = value;
} else _maxFontSize = 30;
// Dispatch the event to trigger data binding.
dispatchEvent(new Event("maxFontSizeChanged"));
}

相關(guān)文章

最新評論