It seems like reusing animators would work well for the common case of changing the to attribute. We could create new animators when relative, duration or motion change from the last animate() call.
As it stands, explicit <animator>s must be created if they're to be reused - I thought i'd open this up for discussion at least, but I'm convinced we should leave animate() as-is... On May 26, 2010, at 8:25 AM, André Bargull <[email protected]> wrote: > Err, how is that supposed to work? The "relative", "duration" or "motion" > attributes may be different, this makes using a single animator a bit > difficult. > Consider this simple test, currently it creates a bounce effect because the > motion attribute is different for the two animations. If both animations were > mixed into a single animator, the red view wouldn't move at all (because > "foo.x - 100 + 100 = foo.x"). > > <view id="foo" x="100" width="100" height="100" bgcolor="red" /> > <method name="testAnimation"> > foo.animate('x', -100, 1000, true, {motion: 'easein'}); > foo.animate('x', +100, 1000, true, {motion: 'easeout'}); > </method> > > >> It would it be more efficient to have a single animator per attribute >> and reuse that... Is there an advantage to having multiple simultaneous >> animators running at the same time, vs. setting the 'to' attribute on an >> existing animator? >> >> -- >> Regards, >> Max Carlson >> OpenLaszlo.org >> >
