[Laszlo-dev] Continued: swf9 and attribute constraint peculiarity
P T Withington
ptw at pobox.com
Mon Oct 5 07:45:47 PDT 2009
For the currently released version of OL (4.6), if you download the
Flash debug player, you will at least get a pop-up notification,
rather than a silent failure. You can download the debug player here:
http://www.adobe.com/support/flashplayer/downloads.html
We've just added a feature in trunk to make swf9/10, when compiled in
debug mode, catch and report these errors. We've also added
backtracing to the swf9/10 platform. See:
http://jira.openlaszlo.org/jira/browse/LPP-8479
This feature will be available in tomorrow's trunk-nightly build, and
in the 4.7 release.
On 2009-10-05, at 09:54, Quirino Zagarese wrote:
> Hi,
> I experimented a couple situations where swf9 code silently fails.
> The first
> one is the one Rami reported.
> If you try to call a method without args, but it declares some args,
> execution silently fails too.
> Same result if you try to do: var x = doSomething() where
> "doSomething" is a
> void method.
> I wonder if the swf9 architecture can catch these errors in order to
> display
> a laszlo error.
> Regards,
>
> Quirino
>
> 2009/10/5 Max Carlson <max at openlaszlo.org>
>
>> That's correct. Constraints will only work properly with OL
>> attributes.
>> Things like array.length don't tell the runtime when they change,
>> so the
>> constraint doesn't know when to update...
>>
>>
>> Rami Ojares / AMG Oy wrote:
>>
>>> It probably has something to do with the dependencies...
>>> Maybe my code is incorrect when it refers to
>>> "parent.someArr.length" in
>>> the constraint?
>>> Am I allowed only to refer to attribute names of laszlo nodes in
>>> constraints?
>>> So that dependencies can be constructed properly.
>>>
>>> - rami
>>>
>>> Rami Ojares / AMG Oy wrote:
>>>
>>>> Hi,
>>>>
>>>> I stumbled upon a problem with swf9 (and up) attribute constraints.
>>>>
>>>> Here is sample code that works in swf8 but fails silently in swf9
>>>>
>>>> <!-- The problem is with setting of bgcolor attribute -->
>>>> <canvas debug="true">
>>>> <view name="test">
>>>> <attribute name="someArr" value=" new Array()"/>
>>>> <view width="100" height="100"
>>>> bgcolor="${parent.someArr.length == 0 ? 'red' : 'blue'}" x="30"
>>>> y="45">
>>>> <handler name="oninit">
>>>> Debug.inspect(parent.someArr.length == 0)
>>>> </handler>
>>>> </view>
>>>> </view>
>>>> </canvas>
>>>>
>>>> Here the same thing slightly modified so that it works in swf9
>>>>
>>>> <!-- The problem is with setting of bgcolor attribute -->
>>>> <canvas debug="true">
>>>> <view name="test">
>>>> <attribute name="someArr" value=" new Array()"/>
>>>> <view width="100" height="100" bgcolor="$
>>>> {this.hasErrors() ?
>>>> 'red' : 'blue'}" x="30" y="45">
>>>> <handler name="oninit">
>>>> Debug.inspect(parent.someArr.length == 0)
>>>> </handler>
>>>> <method name="hasErrors">
>>>> return parent.someArr.length == 0;
>>>> </method>
>>>> </view>
>>>> </view>
>>>> </canvas>
>>>>
>>>> So it seems to me that something gets screwed parsing attribute
>>>> constraints in swf9.
>>>> Any ideas?
>>>>
>>>> - rami
>>>>
>>>
>>>
>> --
>> Regards,
>> Max Carlson
>> OpenLaszlo.org
>>
>
>
>
> --
> Quirino Zagarese
>
> Italian OpenLaszlo Community - www.laszloitalia.org
>
> EU4RIA: Laszlo+Java, easily - eu4ria.googlecode.com
More information about the Laszlo-dev
mailing list