Untested but how about... [Bindable] private var textInput:TextInput = new TextInput(); private var val:Validator = new Validator();
textInput.id = "myText"; //Don't know why you need this as you can refer to the TextInput by its variable name (textInput) val.source = textInput.text; val.required = true; --- In flexcoders@yahoogroups.com, "Adnan" <ad...@...> wrote: > > Hello, > > How can I represent the following validator in action script; > > <mx:Validator > required="true" > source="{myText}" > /> > <s:TextInput id="myText" /> > > I am starting with this; > > var textInput:TextInput = new TextInput(); > textInput.id = "myText"; > > var val:Validator = new Validator(); > val.source = ;// problem how to define it to be bindable ? > val.required = true; > > Any ideas? >