Yep, good re-factor. -TH
--- In flexcoders@yahoogroups.com, Ivan Perez <manope...@...> wrote: > > Why not stop and return when validForm just turns false, like this: > > On Mon, May 18, 2009 at 5:54 PM, Tim Hoff timh...@... wrote: > > > > > > > * > > > > import > > * mx.core.UIComponent; > > > > *private* *function* formIsValid():Boolean > > { > > > > * for* (*var* i:int = 0; i < *this*.numChildren; i++) > > { > > * if* ( UIComponent(*this*.getChildAt(i)).errorString != *""* ) > > { > > *return* *false*; > > } > > } > > > > * **return* *true*; > > } > > > > -TH > > > > > > --- In flexcoders@yahoogroups.com, "sminrana" sminrana@ wrote: > > > > > > first you trying to use numChildren as a method but it is not it is a > > > property which return int value and it is read-only so remove the () in > > the loop > > > > > > second what is errorString ??? > > > > > > > > > > > -- > Ivan Perez - Desenvolvimento Tecnológico > TecSinapse - www.tecsinapse.com.br > 11 9324-0097 / 19 8812-0809 >