# Volume Slider bar Innital volume

**URL:** <https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522>\
**Category:** Uncategorized\
**Created:** [April 6, 2004, 6:09pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522 "2004-04-06T18:09:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdixon](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@sdixon](https://forum.kirupa.com/u/sdixon)\
**Post date:** [April 6, 2004, 6:09pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/1 "2004-04-06T18:09:32Z")

</div>

I need a simple solution for my volume slider bar problem, I completed the volume slider bar tut. on kirupa and it works for what i’m doing, but i’d like the volume to default to 70 or 80 instead of 0, so that the music plays when the movie starts. I’m sure this is a simple line of code that i’m overlooking, any help would be appreciated.

Thanks!  
[scott.dixon@itron.com](mailto:scott.dixon@itron.com)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 6, 2004, 7:31pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/2 "2004-04-06T19:31:15Z")

</div>

you can use

```auto

mySound.setVolume(70);

```

that will start your sound at 70

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 6, 2004, 9:16pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/3 "2004-04-06T21:16:18Z")

</div>

Define the “volume” variable within the [font=courier new]load[/font] event:

```auto
onClipEvent (load) {
	mySound = new Sound();
	mySound.loadSound("sound2.mp3", false);
	//set the initial volume
	_root.volume = 70;
	//put the "dragger" movie clip in right position according to the volume
	dragger._x = line._width*_root.volume/100;
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 6, 2004, 9:37pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/4 "2004-04-06T21:37:06Z")

</div>

Thanks! that fixed it!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 6, 2004, 9:38pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/5 "2004-04-06T21:38:15Z")

</div>

No problem. 🙂  
And welcome to kirupaForum, by the way. 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 6, 2004, 10:41pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/6 "2004-04-06T22:41:18Z")

</div>

Thanks, I appreciate the welcome. I already have another question though…

There’s two tuts. on Kirupa on how to handle sound, one to build a soundbar and the other on how to build a volume bar. I’m trying to build a soundbar with a volume bar in it with multiple audio files. The soundbar has the audio loop imported into the library and loops alot cleaner than loading the audio file from an external MP3, which has a soundgap at the end of the loop track.

The problem is that my volume bar only references the loaded sound, not the native sound. What’s the best way to control the master volume of the movie, or is there a better way to load a soundloop?? Thanks again for all the help.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 6, 2004, 11:14pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/7 "2004-04-06T23:14:11Z")

</div>

Coud you attach your file(s)? It would be easier for me to solve the problem having something to work with. 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 6, 2004, 11:50pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/8 "2004-04-06T23:50:06Z")

</div>

download my source here:

[http://www.siliconenergy.com/flashtest/dl/sound.zip](http://www.siliconenergy.com/flashtest/dl/sound.zip)

I diddn’t include the external sound file, but the embedded one is still native.  
Thanks again for all the help.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 7, 2004, 12:41am UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/9 "2004-04-07T00:41:44Z")

</div>

Here’s you FLA, I’ve deleted the sound symbol from the Library in order to meet to file size limit.

All you have to is to import the sound into the Library, right-click over the sound symbol, select “Linkage” from the menu, check the “Export for ActionScript”, uncheck the “Export in first frame” box, and make sure that the identifier for your sound is “Infin-calpomat-4672.wav”.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 7, 2004, 4:45pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/10 "2004-04-07T16:45:20Z")

</div>

Thanks so much Kode, you’ve been a huge help.

S.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 7, 2004, 5:20pm UTC](https://forum.kirupa.com/t/volume-slider-bar-innital-volume/106522/11 "2004-04-07T17:20:16Z")

</div>

You’re welcome. :beam:
