(2.4.5)Is there any getClipByName() like methods in Animation?

For example, I need to know the duration of the animations before the animation starts playing actually (to build some “wait until animation ends” mechanism). How to I get the animation duration by animation name? I only found something like:

`getClips()[0].duration`

but in my case I want to get the clip by animation name instead of index. Is there any getClipByName() like methods?

Note: currently using 2.4.5 version, seems the following code:

```
animation.getState("myAnimationName");
```

is not working because getState method doesn’t exist

Have a try to call getAnimationState function of animation. If the method doesn’t exist, you can upgrade the Cocos to 2.4.14.