History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5338
Type: Bug Bug
Status: Open Open
Priority: P1 P1
Assignee: P T Withington
Reporter: Maynard Demmon
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

LzView play attribute doesn't work as advertised.

Created: 07/Jan/08 07:59 PM   Updated: 31/Jul/08 01:47 PM
Component/s: LFC - Animation
Affects Version/s: RingDing (4.1), Eskimo Pie (4.0.8)
Fix Version/s: KrispyKreme (4.2 Beta)

Time Tracking:
Not Specified

Severity: Minor
Runtime: N/A
Fix in hand: False


 Description  « Hide
Setting play="false" on a view with an animated resource does not prevent it from playing when it loads. However, you can set it to play="${false}" which does work. Debug statements in the setPlay method revealed that the "play" function is being passed in, not the boolean value. There is probably also some conflict with the play method of LzView going on. See LPP-5337 for a test case showing the work around of ${false} in action.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
P T Withington - 09/Jan/08 09:24 AM
Moving fix target to ringding as Eskimo Pie is released.

P T Withington - 11/Jan/08 02:41 PM
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>

P T Withington - 11/Jan/08 03:35 PM
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.)

Amy Muntz - 23/Jan/08 10:54 AM
Have a workaround. Downgrading to p1.