The problem is that the onstop is sent before the final increment is added by the animator: you are seeing the n-1 value. This is (also) a bug, which I'll ask Bret to file. He also said he might have a workaround.

You could still wrap the text subview in a state, but don't turn the state on/off in response to mousein/mouseout -- that's where you'll run into the lost mouse event that's described in LPP-1248.

jim

On Dec 19, 2005, at 1:48 PM, Denis Bohm wrote:

My concern with that approach is that when I animate the object for other reasons the controls may pop up unexpectedly.  Right now I'm checking the width in the onstop even for the appropriate animation.  But it doesn't seem to be consistently working - sometimes the animation completes but no controls show up.  Maybe there is some rounding error in the final width value...

Jim Grandy wrote:
I think you'll run into LPP-1248 with that technique, which will cause the view width to go to zero. See the thread from last week where we discussed this.

Bret's suggestion is the most efficient way of doing this, but I think the visible="${ parent.width==200}" technique would work as well without being wrapped in a state, just less efficiently:

<canvas>
  <view ...>
<text text="Text" visible="${parent.width==200}"/>
  </view>
</canvas>

jim

On Dec 19, 2005, at 12:50 PM, Jeff Freedman wrote:

Denis,

 

The following code does nicely what I believe you’re looking for using states:

 

<canvas>

<view width="100" height="100" bgcolor="red" onmouseover="min.remove();max.apply()" onmouseout="max.remove();min.apply()">

            <state name="max" apply="false">

                  <animator attribute="width" to="200" duration="2000" />

                  <text name="content" text="Text" visible="${parent.width==200}"/>

            </state>

            <state name="min" apply="true">

                  <animator attribute="width" to="100" duration="2000" />

            </state>

</view>

</canvas>

 

Note the visible=”${parent.width==200}” which sets the text visible only if the view’s width = 200.

 

Jeff

 


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to