[xinf] DOM Events?
Nicolas Cannasse
ncannasse at motion-twin.com
Thu Jun 22 20:22:43 CEST 2006
The important part is what the end-user will have to deal with.
This show for example how to register events :
> public function new() {
> var b = new Button();
> // we have an handleEvent (must be public)
> b.onRefresh.addListener(this);
> // create and adaptor
> b.onClick.addListener(new Listener(handleClick));
> }
>
> function handleClick( evt : ClickEvent ) {
> // TODO
> }
>
> public function handleEvent( evt : RefreshEvent ) {
> // TODO
> }
Of course, everything is strictly typed so no error can occur.
Nicolas
More information about the xinf
mailing list