Jump to content

MovieClip animationSpeed


weavejester
 Share

Recommended Posts

I've been trying to work out how to set the frame rate for a MovieClip animation. I assume this is where the animationSpeed property comes in, but the API documentation is rather vague:

Quote

animationSpeednumber

The speed that the MovieClip will play at. Higher is faster, lower is slower

What does this mean in terms of frames per second? If I want an animation to play at, say, 15 FPS, what value should the animationSpeed property be?

Link to comment
Share on other sites

By default, I believe it plays animations assuming 60fps.

You can control the time for each frame however, by changing slightly how you create one

For example, if you wanted a 10fps animation, instead of

let textures = [texture1, texture2, texture3, texture4, texture5]; 
let coolAnimation = new MovieClip(textures);
coolAnimation.animationSpeed = 0.166;

You can do

let textures = [
  {texture: texture1, time: 100},
  {texture: texture2, time: 100},
  {texture: texture3, time: 100},
  {texture: texture4, time: 100},
  {texture: texture5, time: 100}
]

let coolAnimation = new MovieClip(textures);

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...