This is not thought out, but should work.
, FormWatcher, . , , - CreationComplete .
, , , getChildren() , FormItems . , TextInputs, Comboboxes .., ( ), .
protected function changeHandler(event:Event):void
{
trace ("something is dirty");
}
protected function startWatching(passTheFormHere:Form):void
{
for each (var O:Object in passTheFormHere.getChildren())
{
if (O is FormItem)
{
addChangeHandlerFor((O as FormItem).getChildAt(0));
}
}
}
protected function addChangeHandlerFor(someComponent:Object):void
{
(someComponent).addEventListener(Event.CHANGE,changeHandler);
}
- startWatching (nameOfYourForm), , changeHandler.
:
1) , .
2) , :
<mx:Form id="form1" >
[...]
</mx:Form>
<FormWatcher form="{form1}" />
FormWatcher var, "" - .
3) , , :
<mx:Form id="myForm" >
<mx:FormItem>
<mx:TextInput id="someComponent1" />
</mx:FormItem>
<mx:FormItem>
<mx:CheckBox id="someComponent2" />
</mx:FormItem>
<mx:FormItem>
<mx:TextArea id="someComponent3" />
</mx:FormItem>
</mx:Form>