# netStream pause/play problem

**URL:** <https://forum.kirupa.com/t/netstream-pause-play-problem/267155>\
**Category:** flash\
**Created:** [July 29, 2008, 8:18am UTC](https://forum.kirupa.com/t/netstream-pause-play-problem/267155 "2008-07-29T08:18:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![syph0s](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@syph0s](https://forum.kirupa.com/u/syph0s)\
**Post date:** [July 29, 2008, 8:18am UTC](https://forum.kirupa.com/t/netstream-pause-play-problem/267155/1 "2008-07-29T08:18:41Z")

</div>

Hi all, this is first thread here so hello!

I used David Stiller’s tutorial for loading an external FLV using NetStream. I have it loading in the background, and playing as an ambiance to the website.

My predicament is that I’m using two buttons / instances for the pause & play feature, but it is not working for the play. It pauses just fine, but then when you hit play, it just restarts the movie. It works correctly when I use only one button, and one instance. But I need the two buttons so that I can fade the background in and out, and fade the on/off button in and out. Here’s the setup:

[LEFT]\_root level has an MC instance called [FONT=Fixedsys]bgVidContent[/FONT], which has the video and a MC graphic that is white and fades in and out to cover the video. The other \_root MC is one called [FONT=Fixedsys]on\_off[/FONT], inside of which houses the load FLV code, and the buttons [FONT=Fixedsys]playBtn [/FONT]and [FONT=Fixedsys]pauseBtn[/FONT].

Here’s the code:

[LEFT]inside [FONT=Fixedsys]on\_off

[FONT=Arial][COLOR=Red]// loadFLV  
var nc:NetConnection = new NetConnection();  
nc.connect(null);  
var ns:NetStream = new NetStream(nc);  
\_root.bgVidContent.mainBg\_vid.attachVideo(ns);  
ns.play(“flvs/07229 flipped.flv”);

// pauseFLV  
pauseBtn.onRelease = function() {  
ns.pause(true);  
}  
playBtn.onRelease = function() {  
ns.pause(false);  
}[/COLOR][/FONT]

[/FONT][/LEFT]  
[/LEFT]  
the [FONT=Fixedsys]pauseBtn [/FONT]code:

[LEFT][FONT=Arial][COLOR=Red]on(release) {  
this.gotoAndPlay(“2”);  
this.\_parent.bgVidContent.fadeInOut\_switch.gotoAndPlay(“2”);  
}[/COLOR][/FONT]  
[/LEFT]

the [FONT=Fixedsys]playBtn [/FONT]code:

[LEFT][FONT=Arial][COLOR=Red]on(release) {  
this.gotoAndPlay(“20”);  
this.\_parent.bgVidContent.fadeInOut\_switch.gotoAndPlay(“16”);  
}[/COLOR][/FONT]  
[/LEFT]

\*I would provide an .fla or image but it is client work :shh:  
\*  
Thanks for all your help!

+Chris
