User Guide
Incorporating existing components within your component 179
invalidate();
}
/* Event Handler:
Called by the LogIn button when it receives a mouse click.
Since we want this event to be accessible outside of the scope of
this component, The click event is dispatched using dispatchEvent. */
public function click(evt){
// Update the member variables with the input field contents.
__name = name_ti.text;
__password = password_ti.text;
// Dispatch a click event when the button fires one.
dispatchEvent({type:"click"});
}
/* This is the getter/setter for the name property.
The [Inspectable] metadata makes the property appear
in the Property inspector and allows a default value
to be set. By using a getter/setter you can call invalidate
and force the component to redraw when the value is changed. */
[Bindable]
[ChangeEvent("change")]
[Inspectable(defaultValue="")]
function set name(val:String){
__name = val;
invalidate();
}
function get name():String{
return(__name);
}
[Bindable]
[ChangeEvent("change")]
[Inspectable(defaultValue="")]
function set password(val:String){
__password=val;
invalidate();
}
function get password():String{
return(__password);
}
}