# \[CS3 AS2\] Adding music, then turning it all the way down the all the up with a button

**URL:** <https://forum.kirupa.com/t/cs3-as2-adding-music-then-turning-it-all-the-way-down-the-all-the-up-with-a-button/268577>\
**Category:** flash\
**Created:** [August 15, 2008, 1:42pm UTC](https://forum.kirupa.com/t/cs3-as2-adding-music-then-turning-it-all-the-way-down-the-all-the-up-with-a-button/268577 "2008-08-15T13:42:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktomasso](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@ktomasso](https://forum.kirupa.com/u/ktomasso)\
**Post date:** [August 15, 2008, 1:42pm UTC](https://forum.kirupa.com/t/cs3-as2-adding-music-then-turning-it-all-the-way-down-the-all-the-up-with-a-button/268577/1 "2008-08-15T13:42:24Z")

</div>

I don’t know really the first thing about writing Actionscript, but I know what I want to do is very simple if someone could bear with my ignorance.

All I want to do is add a music stream on the timeline (frame 9 to be exact). The music must be in synch with the timeline.

From there I want to have a button on the bottom that allows me to mute the music (not by stopping it, but by turning it all the way down. If they turn it back on it needs to pick up where it left off).

From what I can gather, it seems that I add a keyframe on frame 9 with actions something like:

```auto
soundTrack = new Sound ( );
soundTrack.attachSound ("RockLight991-V010-PaulaJane-Dellay.mp3");
soundTrack.setVolume (100);
soundTrack.start (0);

```

I’m not sure how correct this is, or even what I’m supposed to put before this (ie:

```auto
on (WhatDoIdo...)

```

).

From there I feel like I add some actions to the button, ie:

```auto
on (release) {
    soundTrack.setVolume(0);
    soundTrack.setVolume(100);
}

```

If someone can tell me in baby steps how close I am, and how to do this simple task, I will greatly appreciate it. Thanks in advance!
