# Turning a NetConnection off

**URL:** https://forum.kirupa.com/t/turning-a-netconnection-off/272932
**Category:** flash
**Created:** [October 9, 2008, 2:21pm UTC](https://forum.kirupa.com/t/turning-a-netconnection-off/272932 "2008-10-09T14:21:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![will\_s](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@will\_s](https://forum.kirupa.com/u/will_s)
#### Post date: [October 9, 2008, 2:21pm UTC](https://forum.kirupa.com/t/turning-a-netconnection-off/272932/1 "2008-10-09T14:21:26Z")

</div>

This code is on the opening frame of one of my Flash files:

```auto
var myConnection:NetConnection = new NetConnection();
myConnection.connect("rtmp://fvss.playstream.com/fvssod/myclient");
var myStream:NetStream = new NetStream(myConnection);

myVideo.attachVideo(myStream);
myStream.play("iLoveLALong");

```

It starts this song “iLoveLALong” as background music. Works great. But now I need to turn the music off when I jump to another frame in the Flash doc.

Can anyone suggest code that will do that, either with frame code or button code?

Thanks.
