[Laszlo-dev] delegates *must* have an argument?
P T Withington
ptw at pobox.com
Thu Mar 19 12:19:31 PDT 2009
I write args="ignore" as a way of self-documenting this case.
There is no way around this that would not involve a lot of overhead.
Note that if you use the <handler> tag to write your method, the
compiler will take care of you. It is only if you write your method
separately that this is an issue.
On Mar 19, 2009, at 15:07, Antun Karlovac <antun at laszlosystems.com>
wrote:
> Yeah, you have to have one argument now for methods that get called
> by delegates. It's annoying. Happened in 4.1 (http://www.antunkarlovac.com/blog/2008/07/02/migrating-lzx-code-to-openlaszlo-41/
> ).
>
> I wonder if the arguments should be documented if they're only there
> for the purpose of avoiding the compiler warning? (e.g. when you
> write args="arg").
>
> -Antun
>
> Sarah Allen wrote:
>> So, I've got this code...
>> <method name="_activateTimeDel">
>> //Debug.write("mediastream._activeTimeDel()", this);
>> if (!this._timedel) {
>> this._timedel = new LzDelegate(this, "_updateTime");
>> }
>> this._timedel.unregisterAll();
>> this._timedel.register(lz.Idle, "onidle");
>> </method>
>> I had noticed that _updateTime had an unused (and undocumented)
>> argument 'v' which I removed to make the code cleaner and clearer.
>> However, in the swf9 runtime, I learn that delegates *must* be
>> declared with an argument:
>> WARNING: Invalid delegate: mediastream name: ms._updateTime =>
>> Function (must accept one argument)
>> So, I go look up in the reference to see what the argument is and
>> find no mention of it. Is this a doc omission?
>> just curious... for now, I'll just put back the mysterious 'v'
>> Sarah
More information about the Laszlo-dev
mailing list