Denis,
For the behavior that you are trying to achieve, the use of the onstop
event is not appropriate. An onstop is always generated when a single
animation completes on an object but the "value" of that object is not
guaranteed to be the same as the value defined by the "to" attribute of
that animator. Animators can be defined with absolute values, but
ultimately all animators are translated into a relative space so that
when they are executed, their behavior is more physics-like.
What you want to know is when the width of an object reaches a certain
value, and at that point display the text. This should be independent of
the animation, so my suggestion is that you override the SetWidth method
of the object and in that method check to see if the max value is being
set. At that max value display the text otherwise hide it.
Bret Simister
Chief Interface Architect
Henry Minsky wrote:
animatorgroup is supposed to support 'onstop' event, but after brief
look at the LFC source code to me it looks like animator doesn't send
that event. Anyone more familiar with this?
On 12/16/05, *Denis Bohm* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
I'm trying to detect when an animator has completed changing an
attribute to the "to" value. In the example below what I want to
happen
is that when you move the mouse into the red area then the area grows
and if the grow completes then the text will become visible. When you
move the mouse out of the red area then the text becomes invisible
and
the view shrinks back. This works fine if you hold the mouse
inside the
red are until the "max" animation completes. But if you move the
mouse
back out of the view before it completes then an "onstop" event is
generated for "max" and it does not act as desired. So what I'm
looking
for is something like and "oncomplete" event that is only called
if the
animation makes it to the to value. Is there some way to detect
that?
<canvas>
<view width="100" height="100" bgcolor="red"
onmouseover="max.doStart()" onmouseout="min.doStart()">
<animator name="max" attribute="width" to="200"
duration="2000"
start="false" onstop="parent.content.setAttribute('visible', true);"/>
<animator name="min" attribute="width" to="100"
duration="2000"
start="false" onstart=" parent.content.setAttribute('visible',
false);"/>
<text name="content" text="Text" visible="false"/>
</view>
</canvas>
_______________________________________________
Laszlo-dev mailing list
[email protected] <mailto:[email protected]>
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
<http://www.openlaszlo.org/mailman/listinfo/laszlo-dev>
--
Henry Minsky
Software Architect
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
------------------------------------------------------------------------
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev