[Laszlo-dev] swf9 and attribute constraint peculiarity

Rami Ojares / AMG Oy rami.ojares at archon.fi
Mon Oct 5 05:57:11 PDT 2009


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


More information about the Laszlo-dev mailing list