package sample3
{
import flash.events.EventDispatcher;
public class Sample3Model extends EventDispatcher
{
private var _lastname : String;
private var _firstname : String;
[Bindable]
public var validatorGroup : Sample3ValidatorGroup =
new Sample3ValidatorGroup();
public function Sample3Model()
{
validatorGroup.model = this;
validatorGroup.initialized( this, "sample3Model" );
validatorGroup.validate( true );
}
public function set firstname( value : String ) : void
{
_firstname = value;
dispatchEvent( new Event("firstnameChanged") );
}
[Bindable(event="firstnameChanged")]
public function get firstname() : String
{
return _firstname;
}
public function set lastname( value : String ) : void
{
_lastname = value;
dispatchEvent( new Event("lastnameChanged") );
}
[Bindable(event="lastnameChanged")]
public function get lastname() : String
{
return _lastname;
}
public function get isValid() : Boolean
{
return validatorGroup.isValid;
}
}
}