Loading ...
Sorry, an error occurred while loading the content.

Reusing an Animation

Expand Messages
  • foti-1@comcast.net
    The animation constructor requires that you pass in an element or id of the element that the animation will apply to. Is it possible to re-use an animation on
    Message 1 of 2 , Nov 30, 2006
    View Source
    • 0 Attachment
      The animation constructor requires that you pass in an element or id of the element that the animation will apply to. Is it possible to re-use an animation on different elements?

      For example, look at the Spotlight design pattern example:
      http://developer.yahoo.com/ypatterns/pattern.php?pattern=spotlight#

      Each time an item is dynamically added, it has a little bit of spotlight applied to it. It seems to me that rather than create a new animation object every time I add something, I should be able to just create one and re-apply it to each new element that is created. Why keep recreating an Animation object when it's doing the same thing over and over again?

      It doesn't look like it's possible to re-assign an Animation object though. Is that the case?

      Thanks,
      Peter Foti
    • Matt Sweeney
      Hi Peter, Reusing animation instances with different elements is not currently supported, but will be in a future release. Matt
      Message 2 of 2 , Dec 1, 2006
      View Source
      • 0 Attachment
        Hi Peter,

        Reusing animation instances with different elements is not currently
        supported, but will be in a future release.

        Matt

        foti-1@... wrote:

        >The animation constructor requires that you pass in an element or id of the element that the animation will apply to. Is it possible to re-use an animation on different elements?
        >
        >For example, look at the Spotlight design pattern example:
        >http://developer.yahoo.com/ypatterns/pattern.php?pattern=spotlight#
        >
        >Each time an item is dynamically added, it has a little bit of spotlight applied to it. It seems to me that rather than create a new animation object every time I add something, I should be able to just create one and re-apply it to each new element that is created. Why keep recreating an Animation object when it's doing the same thing over and over again?
        >
        >It doesn't look like it's possible to re-assign an Animation object though. Is that the case?
        >
        >Thanks,
        >Peter Foti
        >
        >
        >
        >Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.