# Problem with volume control slider

**URL:** https://forum.kirupa.com/t/problem-with-volume-control-slider/153049
**Category:** flash
**Created:** [June 28, 2005, 11:22pm UTC](https://forum.kirupa.com/t/problem-with-volume-control-slider/153049 "2005-06-28T23:22:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cameron\_](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cameron\_](https://forum.kirupa.com/u/cameron_)
#### Post date: [June 28, 2005, 11:22pm UTC](https://forum.kirupa.com/t/problem-with-volume-control-slider/153049/1 "2005-06-28T23:22:53Z")

</div>

I have done this turtorial [http://www.kirupa.com/developer/mx/volume\_slider.htm](http://www.kirupa.com/developer/mx/volume_slider.htm)  
which worked very well. I need to have the track play as soon as it is loaded, without having to push the play button. I added some script to the onEnterFrame event, but that dosnt work, becuase it just keeps playing over and over on top of each other. Can anyone help?

```auto

 
onClipEvent (load) {
 mySound = new Sound();
 mySound.loadSound("rak2.mp3", false);
 speed = 5;
 volume = 0;
 _root.volume = 100;
 dragger._x = line._width*_root.volume/100;
}
onClipEvent (enterFrame) {
 downloaded = mySound.getBytesLoaded();
 total = mySound.getBytesTotal();
 if (downloaded != total) {
  _root.dl = "downloading song...";
 } else {
  complete = 1;
  _root.dl = "";
  _root.mySlider.mySound.start(0, 99); //my poorly added script
 }
 d = (_root.volume>volume)-(_root.volume<volume);
 volume += d;
 mySound.setVolume(volume);
}

```
