# \[Flash 8\] FLV Play and then Pause?

**URL:** <https://forum.kirupa.com/t/flash-8-flv-play-and-then-pause/287440>\
**Category:** flash\
**Created:** [May 1, 2009, 2:41am UTC](https://forum.kirupa.com/t/flash-8-flv-play-and-then-pause/287440 "2009-05-01T02:41:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SuzyCreamcheese](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@SuzyCreamcheese](https://forum.kirupa.com/u/SuzyCreamcheese)\
**Post date:** [May 1, 2009, 2:41am UTC](https://forum.kirupa.com/t/flash-8-flv-play-and-then-pause/287440/1 "2009-05-01T02:41:06Z")

</div>

[FONT=“Times New Roman”][SIZE=“4”][/SIZE][/FONT]  
Hello,

```
      I am using the videosourcepro code for a video player. What I would like to do is have the video play to a specific point and then pause. The code is as follows, opening up with the video playing and then the option of pressing the first button to play the same video

```

var nc:NetConnection =new NetConnection();  
nc.connect(null);  
var ns:NetStream = new NetStream(nc);  
amyvideo.attachVideo(ns);  
ns.play(“1.flv”);  
// xml playlist  
// create an XMl object  
var vidList:XML = new XML();  
// ignore white spaces  
vidList.ignoreWhite = true;  
vidList.onLoad = function() {  
// put the nodes of xml into array  
var videoArray:Array = this.firstChild.childNodes;  
// iterate through video array  
// and add videos to the listbox  
for (var i = 0; i\<videoArray.length; i++) {  
videoList.addItem(videoArray\*.attributes.desc, videoArray\*.attributes.url);  
}  
// when xml is loaded play first item  
ns.play(videoList.getItemAt(0).data);  
// highlight first video in listbox  
videoList.selectedIndex = 0;  
};  
// create a listener that responds  
// to changes in the listbox  
var vidListener:Object = new Object();  
vidListener.change = function() {  
// play the item selected in listbox  
ns.play(videoList.getItemAt(videoList.selectedIndex).data);  
};  
// register the event listener to listbox  
videoList.addEventListener(“change”, vidListener);  
// load xml file  
vidList.load(“videos.xml”);  
button1.onRelease = function(){  
ns.play(“1.flv”);  
gotoAndPlay(1);  
}

```
                Thank you in advance,
                                             SuzyCreamcheese
```
