Paul Stearns
Paul Stearns

Reputation: 906

Binding using ActionScript

I have customized textinput control with a property of x. In my program I instantiate the control as vtiA. My program has a bindable variable called _y.

I would like everytime that _y is changed by my program that the property x of the control vtiA reflects the new values.

What I have done that does not work is

[Bindable] private var _y;

private function whocares():void
{
var vtiA:MyTextInput = new MyTextInput;
vtiA.x = _y
}

If this were mxml I would just say;

<xx:MyTextInput id="vtiA" x="{_y}"/>

What is the equivalent in as3?

Paul

Upvotes: 2

Views: 97

Answers (1)

user1901867
user1901867

Reputation:

[Bindable] only works on public properties. So you need:

[Bindable] public var _y;

Upvotes: 1

Related Questions