[Laszlo-dev] swf9 and components
Philip Romanik
promanik at laszlosystems.com
Thu Apr 24 14:15:32 PDT 2008
Hi Tucker,
I took a whack at fixing errors to get an example app (contactlist in
my case) to run in swf9 (well, it displays properly but clicking is
not working). I learned a few things while making the changes.
1. method attribute for handler.
This code doesn't run in swf9:
<handler name="oninit" reference="canvas" method="_showEnabled" />
<method name="_showEnabled">...</method>
The problem is _showEnabled does not have an argument and the handler
will add one. My workaround is:
<handler name="oninit" reference="canvas">_showEnabled();</handler>
<method name="_showEnabled">...</method>
2. Specifying type information in overrides.
If a base class specifies type information it must be specified in
all overrides. For example, LzNode defines setSelected():
function setSelected (sel:Boolean) /* :void */ {}
setSelected() is overridden in components but it does not compile as written:
<method name="setSelected" args="s">
The fix is to specify the type information:
<method name="setSelected" args="s:Boolean">
Optional arguments must also be specified so the function signature
is identical. This is going to be very cumbersome and is going to
require changes to the components as well as applications. Maybe we
should rethink specifying the type on public methods.
Thanks!
Phil
More information about the Laszlo-dev
mailing list