# Can anyone help me for this?

**URL:** <https://forum.kirupa.com/t/can-anyone-help-me-for-this/33992>\
**Category:** Uncategorized\
**Created:** [October 26, 2003, 3:40pm UTC](https://forum.kirupa.com/t/can-anyone-help-me-for-this/33992 "2003-10-26T15:40:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![inTheRuSh](https://avatars.discourse-cdn.com/v4/letter/i/f4b2a3/32.png) [@inTheRuSh](https://forum.kirupa.com/u/inTheRuSh)\
**Post date:** [October 26, 2003, 3:40pm UTC](https://forum.kirupa.com/t/can-anyone-help-me-for-this/33992/1 "2003-10-26T15:40:13Z")

</div>

pls download .fla and open itt  
[Download](http://mas-1.unlinked.net/sc/banner.fla) 5MB

as u can see, there is stop,play,volumn bar…  
when run it, i need to press play button to play and also to drag the volumn in order to play the song…

now what i wan is the song will be auto play after run the flash, and the volumn dragger can set the middle which also means the volumn will be set to 50% instead of 0%

anyone know this, pls teach me :P:D thanks…

---

<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:** [October 26, 2003, 3:51pm UTC](https://forum.kirupa.com/t/can-anyone-help-me-for-this/33992/2 "2003-10-26T15:51:54Z")

</div>

link doesn’t work

---

<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:** [October 26, 2003, 4:06pm UTC](https://forum.kirupa.com/t/can-anyone-help-me-for-this/33992/3 "2003-10-26T16:06:25Z")

</div>

> \*Originally posted by scotty \*  
> \*\*link doesn’t work \*\*

link fixed 😉

---

<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:** [October 26, 2003, 4:46pm UTC](https://forum.kirupa.com/t/can-anyone-help-me-for-this/33992/4 "2003-10-26T16:46:05Z")

</div>

first:  
put the “dragger” in mc"mySlider" in the middle.

second:  
put this as in the code layer  
[AS]this.ratio = 50;  
dragger.onPress = function() {  
this.startDrag(true, 0, 0, line.\_width, 0);  
this.onEnterFrame = function() {  
ratio = Math.round(this.\_x\*100/line.\_width);  
};  
};  
dragger.onRelease = dragger.onreleaseOutside=stopDrag;[/AS]

third:  
put this as on your mySlider mc  
[AS]onClipEvent (load) {  
mySound = new Sound();  
choice = Math.round(Math.random()\*1);  
switch (choice) {  
case 0 :  
mySound.loadSound(“SONG1.mp3”, false);  
break;  
case 1 :  
mySound.loadSound(“SONG2.mp3”, false);  
break;  
}  
this.onEnterFrame = function() {  
downloaded = mySound.getBytesLoaded();  
total = mySound.getBytesTotal();  
if (downloaded != total) {  
\_root.dl = “downloading song…”;  
} else {  
complete = 1;  
\_root.dl = “”;  
mySound.start(0, 99);  
delete this.onEnterFrame;  
}  
};  
}  
onClipEvent (enterFrame) {  
mySound.setVolume(ratio);  
}[/AS]

that should work:smirk:

scotty

---

<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:** [October 26, 2003, 5:23pm UTC](https://forum.kirupa.com/t/can-anyone-help-me-for-this/33992/5 "2003-10-26T17:23:56Z")

</div>

thx buddy ^^

but i dun understand this

delete this.onEnterFrame;

why need delete ?

---

<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:** [October 26, 2003, 5:57pm UTC](https://forum.kirupa.com/t/can-anyone-help-me-for-this/33992/6 "2003-10-26T17:57:33Z")

</div>

that onEnterFrame is deleted as soon as the sound is completely loaded and the music starts. if you don’t delete it, music will start on every enterframe, i think you wouldn’t this to happen (try to skip it and see/hear what’s happening(-: )

scotty
