RoloDMonkey
02-13-2007, 12:08 PM
I have spent almost two hours trying to figure this out. It doesn't make any sense. It appears to be a bug, but maybe somebody can help with this. I am using 3.3.3. Here is a distilled version of the code:
<canvas width="100%" proxied="false" height="100%" debug="true"
bgcolor="#FFFFFF">
<dataset name="pagedata" src="xml/professional_furnishings.xml" />
<datapath xpath="pagedata:/page">
<handler name="ondata">
Debug.write(this.xpathQuery("@content_size"));
// canvas.applyState(this.xpathQuery("@content_size"));
</handler>
</datapath>
<state name="small_state">
<handler name="onapply">
canvas.setAttribute("bgcolor", 0xFFDDDD);
</handler>
</state>
<method name="applyState" args="s">
canvas.small_state.apply();
</method>
</canvas>
If I run it as is, the background is white and the word 'medium' is printed to the debug window.
If I remove the comment from this line:
canvas.applyState(this.xpathQuery("@content_size"));
Then I get this in the debug window:
medium
WARNING: content_size.lzx:20: reference to undefined property 'small_state'
WARNING: content_size.lzx:20: undefined object does not have a property 'apply'
And the background color is still white.
What the hell is going on? This is seriously delaying my project. If this is a bug, is there a work-around? Help!
<canvas width="100%" proxied="false" height="100%" debug="true"
bgcolor="#FFFFFF">
<dataset name="pagedata" src="xml/professional_furnishings.xml" />
<datapath xpath="pagedata:/page">
<handler name="ondata">
Debug.write(this.xpathQuery("@content_size"));
// canvas.applyState(this.xpathQuery("@content_size"));
</handler>
</datapath>
<state name="small_state">
<handler name="onapply">
canvas.setAttribute("bgcolor", 0xFFDDDD);
</handler>
</state>
<method name="applyState" args="s">
canvas.small_state.apply();
</method>
</canvas>
If I run it as is, the background is white and the word 'medium' is printed to the debug window.
If I remove the comment from this line:
canvas.applyState(this.xpathQuery("@content_size"));
Then I get this in the debug window:
medium
WARNING: content_size.lzx:20: reference to undefined property 'small_state'
WARNING: content_size.lzx:20: undefined object does not have a property 'apply'
And the background color is still white.
What the hell is going on? This is seriously delaying my project. If this is a bug, is there a work-around? Help!