Correct answertst - . , , init().
init().
-, , init(), .
-, .
, , mxml, , , AS3, - :
private function onCreationComplete(event:Event):void
{
BindingUtils.bindProperty(obj, "mobileNumber", mobileNumberText, ["text"]);
}
:
1/BindingUtils.bindProperty() - " = ". ,
obj.mobileNumber = mobileNumberText.text;
, , :
obj["mobileNumber"] = mobileNumberText["text"];
2/BindingUtils.bindProperty() , . , " " :
obj.mobileNumber = mobileNumbersGrid.selectedItem.text;
BindingUtils.bindProperty(obj, "mobileNumber", mobileNumbersGrid,
["selectedItem", "text"]);
3/ : , (), :
BindingUtils.bindProperty(obj, "mobileNumber", this,
["mobileNumbersGrid", "selectedItem", "text"]);
, " " this.mobileNumbersGrid .
4/ - obj ( " " ), obj. , , obj getter/setter :
public function get obj():MyObject
{
return _obj;
}
private var _obj:MyObject = new MyObject();
public function set obj(value:MyObject):void
{
_obj = value;
BindingUtils.bindProperty(_obj, "mobileNumber", mobileNumberText, ["text"]);
}
(: , BindingUtils.bindProperty(), ChangeWatcher, () , )
, . Flex, . , " ", "".