# Random animation duration

**URL:** <https://phaser.discourse.group/t/random-animation-duration/1956>\
**Category:** Phaser 3\
**Created:** [April 3, 2019, 1:35am UTC](https://phaser.discourse.group/t/random-animation-duration/1956 "2019-04-03T01:35:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Locomotive](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/locomotive/32/1072_2.png) [@Locomotive](https://phaser.discourse.group/u/Locomotive)\
**Post date:** [April 3, 2019, 1:35am UTC](https://phaser.discourse.group/t/random-animation-duration/1956/1 "2019-04-03T01:35:15Z")

</div>

Hello Phaser community ,  
I am a new developer … was trying to make a simple 2D game , but struggled with some stuff  
because my programming knowledge is poor …  
The game Idea is  
When the pointer down an animation start (BOSSTALKS)  
Here is the animation code

```
var frameNames4 = this.anims.generateFrameNames('bossanim', {
                     start: 0, end: 26, zeroPad: 2,
                     prefix: 'bosstalks', suffix: '.png'
                     });

     this.anims.create({ key: 'bosstalks', frames: frameNames4, frameRate: 10});

```

Now this animation duration is the same everytime it plays … what i need to do is to make the duration randomly generated … this animation its a phone call so i need it for example to last 5 sec the first time 15 sec the second time …  
Sorry for my bad use of english and thank you in advance .

---

<div class="post-metadata">

**Author:** ![Locomotive](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/locomotive/32/1072_2.png) [@Locomotive](https://phaser.discourse.group/u/Locomotive)\
**Post date:** [April 3, 2019, 1:40am UTC](https://phaser.discourse.group/t/random-animation-duration/1956/2 "2019-04-03T01:40:01Z")

</div>

I thought of making multiple animations of the phone call with different frame Numbers  
so here its

```
start: 0, end: 26, zeroPad: 2

```

the other one will be like

```
start: 0, end: 40, zeroPad: 2

```

and so on …  
but if did that … how do i call these animations to run randomly in my game  
Now its only one animation and i call it this way ;

```
function onEvent ()
{

    
    tel.anims.play('telrings');
boss.anims.play('bosstalks');

```

if i made multiple animations with different frame numbers how do i call them to run randomly ?
