Skip to main content
Home Forums Silverlight Programming Programming with JavaScript Best Animation Performance?
5 replies. Latest Post by Dave Britton on December 3, 2007.
(0)
John App...
Member
38 points
39 Posts
12-03-2007 11:49 AM |
For a project I am working on I have several pre-rendered PNG sequences for different animated elements. Currently I am using setInterval to callback on functions to flip through the images to simulate animation. Is there a higher performance way of doing this in JavaScript Silverlight?
Dave Bri...
681 points
229 Posts
12-03-2007 12:24 PM |
I think there is a general concencus that creating a empty Storyboard with a set duration, then handling the "complete" event is more efficient that using SetInterval ... Is there no way you can just create a storyboards that shows/hides these in sequence? Perhaps setting the Opacity?
=> Dave
12-03-2007 1:32 PM |
Is it possible to change the Completed parameter dynamically? I need to have a given "interval" call back on different methods.
12-03-2007 1:39 PM |
Not really sure what you are asking ... you can dynamically change the duration of the Storyboard and then retrieve it in the completed event if that helps?
12-03-2007 1:58 PM |
I would like to dynamically set the callback method in a manner similar to setInterval( whateverMethod, 1000 )
sender.findName(
12-03-2007 2:47 PM |
Got it, so in your JS you add events/handlers like this:
sender.findname(
And you can then also use the removeEventListener to remove a handler, so this should allow you to implement what you're looking for.