# Controlling multiple videos playback

**URL:** <https://forum.kirupa.com/t/controlling-multiple-videos-playback/306932>\
**Category:** flash\
**Created:** [March 24, 2010, 6:26pm UTC](https://forum.kirupa.com/t/controlling-multiple-videos-playback/306932 "2010-03-24T18:26:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brown22](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@brown22](https://forum.kirupa.com/u/brown22)\
**Post date:** [March 24, 2010, 6:26pm UTC](https://forum.kirupa.com/t/controlling-multiple-videos-playback/306932/1 "2010-03-24T18:26:34Z")

</div>

Hi everybody,

I’m currently working on a project which includes 7 small 30 second videos inside a mask with no skins. The vids are inside a graphic symbol along with some other animation going on at the same time.

The problem is that I can play and stop the vids just fine but when I use the rewind or forward buttons to go to next video or previous video _all hell breaks loose._ Both videos end up playing at the same time. Very annoying.

Should I be using movieclips instead or is it something else that I’m missing.

Any help would be appreciated,

thanks

Here’s a look at the code:

var timer:Timer = new Timer(6000,1);  
navbar.visible = false

navbar.next\_btn.addEventListener(MouseEvent.CLICK, nextButtonClick);  
navbar.prev\_btn.addEventListener(MouseEvent.CLICK, previousButtonClick);  
navbar.play\_btn.addEventListener (MouseEvent.CLICK, playButtonClick);  
navbar.pause\_btn.addEventListener(MouseEvent.CLICK, stopButtonClick);  
navbar.menu\_btn.addEventListener(MouseEvent.CLICK, menuButtonClick);

timer.addEventListener(TimerEvent.TIMER\_COMPLETE, hidemenu);  
stage.addEventListener(MouseEvent.MOUSE\_MOVE, showmenu);

function hidemenu(e:TimerEvent):void{  
navbar.visible = false;  
}  
function showmenu(e:MouseEvent):void{  
navbar.visible = true;  
timer.start();  
}

function stopButtonClick(e:MouseEvent):void  
{

```
if(VidDesign_1)

```

{  
VidDesign\_1.stop();  
}

```
else if (VidDesign_2)

```

{  
VidDesign\_2.stop();  
}

```
else if (VidDesign_3)

```

{  
VidDesign\_3.stop();  
}

```
 else if (VidDesign_4)

```

{  
VidDesign\_4.stop();  
}

```
 else if (VidDesign_5)

```

{  
VidDesign\_5.stop();  
}

```
 else if (VidDesign_6)

```

{  
VidDesign\_6.stop();  
}

```
 else if (VidDesign_7)

```

{  
VidDesign\_7.stop();  
}

```
stop();

```

}

function playButtonClick(e:MouseEvent):void  
{  
if(VidDesign\_1)  
{  
VidDesign\_1.play();  
}

```
else if (VidDesign_2)

```

{  
VidDesign\_2.play();  
}

```
else if (VidDesign_3)

```

{  
VidDesign\_3.play();  
}

```
else if (VidDesign_4)

```

{  
VidDesign\_4.play();  
}

```
else if (VidDesign_5)

```

{  
VidDesign\_5.play();  
}

```
else if (VidDesign_6)

```

{  
VidDesign\_6.play();  
}

```
else if (VidDesign_7)

```

{  
VidDesign\_7.play();  
}

```
play();

```

}

function previousButtonClick(e:MouseEvent):void  
{

```
if(VidDesign_1)

```

{  
VidDesign\_1.stop();  
}

```
else if (VidDesign_2)

```

{  
VidDesign\_2.stop();  
}

```
else if (VidDesign_3)

```

{  
VidDesign\_3.stop();  
}

```
 else if (VidDesign_4)

```

{  
VidDesign\_4.stop();  
}

```
 else if (VidDesign_5)

```

{  
VidDesign\_5.stop();  
}

```
 else if (VidDesign_6)

```

{  
VidDesign\_6.stop();  
}

```
 else if (VidDesign_7)

```

{  
VidDesign\_7.stop();  
}

```
gotoAndStop(currentFrame - 300);

```

}

function nextButtonClick(e:MouseEvent):void  
{

```
if(VidDesign_1)

```

{  
VidDesign\_1.stop();  
}

```
else if (VidDesign_2)

```

{  
VidDesign\_2.stop();  
}

```
else if (VidDesign_3)

```

{  
VidDesign\_3.stop();  
}

```
 else if (VidDesign_4)

```

{  
VidDesign\_4.stop();  
}

```
 else if (VidDesign_5)

```

{  
VidDesign\_5.stop();  
}

```
 else if (VidDesign_6)

```

{  
VidDesign\_6.stop();  
}

```
 else if (VidDesign_7)

```

{  
VidDesign\_7.stop();  
}

```
gotoAndStop(currentFrame + 300);	

```

}

function menuButtonClick(e:MouseEvent):void  
{

```
if(VidDesign_1)

```

{  
VidDesign\_1.stop();  
}

```
else if (VidDesign_2)

```

{  
VidDesign\_2.stop();  
}

```
else if (VidDesign_3)

```

{  
VidDesign\_3.stop();  
}

```
 else if (VidDesign_4)

```

{  
VidDesign\_4.stop();  
}

```
 else if (VidDesign_5)

```

{  
VidDesign\_5.stop();  
}

```
 else if (VidDesign_6)

```

{  
VidDesign\_6.stop();  
}

```
 else if (VidDesign_7)

```

{  
VidDesign\_7.stop();  
}

```
gotoAndPlay(1);

```

}
