|
|
|
[
Permlink
| « Hide
]
P T Withington - 09/Jan/08 09:24 AM
Moving fix target to ringding as Eskimo Pie is released.
Here is a very simple test case:
<canvas> <resource name="SPINNER_RSRC" src="./spinner.swf" /> <stylesheet> view {bigspinnerresource: "SPINNER_RSRC";} </stylesheet> <simplelayout axis="x"/> <view name="broken" play="false" resource="$style{'bigspinnerresource'}"/> <view name="working" play="${false}" resource="$style{'bigspinnerresource'}"/> </canvas> Here is why it is broken:
TRACE @test.lzx#18: [66359.00] setPlay.apply(#broken, [false, play]) TRACE: [66361.00] LzSprite.prototype.stop.apply(LzSprite for LzView name: broken id: broken , [undefined, undefined]) TRACE: [66364.00] LzSprite.prototype.setResource.apply(LzSprite for LzView name: broken id: broken , [empty]) TRACE: [66367.00] LzSprite.prototype.setResource -> _level0.spriteroot.$m0 TRACE: [66369.00] LzSprite.prototype.stop -> «undefined» TRACE: [66371.00] setPlay -> «undefined» TRACE: [66372.00] LzSprite.prototype.setResource.apply(LzSprite for LzView name: broken id: broken , [SPINNER_RSRC]) TRACE: [66375.00] LzSprite.prototype.setResource -> _level0.spriteroot.$m0 TRACE: [66378.00] LzSprite.prototype.setResource.apply(LzSprite for LzView name: working id: working , [SPINNER_RSRC]) TRACE: [66381.00] LzSprite.prototype.setResource -> _level0.spriteroot.$m1 [... many debugger resource traces elided ...] TRACE @test.lzx#20: [67386.00] setPlay.apply(#working, [false]) TRACE @test.lzx#24: [67394.00] LzSprite.prototype.stop.apply(LzSprite for LzView name: working id: working , [undefined, undefined]) TRACE @test.lzx#24: [67401.00] LzSprite.prototype.stop -> «undefined» TRACE @test.lzx#24: [67406.00] setPlay -> «undefined» This is due to the undefined ordering in which initial arguments are installed by applyArgs. In the broken case, `play` is set before `resource` and hence only the "empty" clip gets stopped. The working case defers the setting of `play` by making it a constraint, so it gets applied _after_ `resource` is set. Max: any thoughts? I think that maybe the queueing of play/stop needs to be used not only when you are loading your resource but also when you don't have any resource at all (e.g., when you will automagically get the empty resource). Feel free to take this if you have a good solution. (I tried making `play` a delayed setter, but that did not seem to help. I think it is because the resource is being installed by applyStyleMap, which happens after _all_ the setters. We really need to rationalize styled attributes with other attributes.) |
||||||||||||||||||||||||||||||||||||||||||||||||