# Setting Delay

**URL:** <https://forum.kirupa.com/t/setting-delay/320871>\
**Category:** Uncategorized\
**Created:** [April 4, 2011, 1:23pm UTC](https://forum.kirupa.com/t/setting-delay/320871 "2011-04-04T13:23:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keitho30](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@keitho30](https://forum.kirupa.com/u/keitho30)\
**Post date:** [April 4, 2011, 1:23pm UTC](https://forum.kirupa.com/t/setting-delay/320871/1 "2011-04-04T13:23:23Z")

</div>

Hi guys,

I have two flv’s loading externally and play one after another and was wondering how to set (let’s say) a 5 second delay in between.

Here is my code at the minute, thanks in advance.

var video1:VideoPlayer = new VideoPlayer();  
container.addChild(video1);  
video1.x = Math.random() \* 700;  
video1.y = Math.random() \* 700;  
video1.scaleX = Math.random() \* 3;  
video1.scaleY = Math.random() \* 3;  
video1.play(“MYVIDEO.flv”);  
video1.addEventListener(VideoEvent.COMPLETE, vidEnd);  
function vidEnd(evt:VideoEvent):void {  
container.removeChild(video1);

```
		var video3:VideoPlayer = new VideoPlayer();
		container3.addChild(video3);
			video3.scaleX = Math.random() * 3;
			video3.scaleY = Math.random() * 3;
			video3.x = Math.random() * 700;
			video3.y = Math.random() * 700;
			video3.play("MYVIDEO_2.flv");
			video3.addEventListener(VideoEvent.COMPLETE, vidEnd3);
			function vidEnd3(evt:VideoEvent):void {
				container3.removeChild(video2);
			}
```
