PDA

View Full Version : RE:Bill Trikojus volume slider component


avelives
03-29-2003, 02:17 PM
I downloaded the vloume slider component from the components section and was wondering if it can be configured to control the volume of dynamicly loaded sound??

Billy T
03-30-2003, 12:10 AM
maybe in version 2

feel free to go through the code yourself

can probably just change line 16 from

theSound.attachSound(this.targSound_param);

to

theSound.loadSound(this.targSound_param,true);

cheers

Billy T
03-30-2003, 12:27 AM
ok I've changed it

will update the component in the components section now

cheers

avelives
03-30-2003, 06:28 PM
cheers but i figured out this way and wondered if you could check it over to see if it can be improved.

I have this code creatng a sound object on the main timeline.
Mysound = new Sound();
this.button1.onPress = function() {
_level1.Mysound.loadSound("I_Used_To_Write_Songs.mp3", false);
_level1.Mysound.start(0);
};
this.button2.onPress = function() {
_level1.Mysound.loadSound("Slavedriver.mp3", false);
_level1.Mysound.start(0);
};
this.button3.onPress = function() {
_level1.Mysound.loadSound("Time_To_Buy_A_Futon.mp3", false);
_level1.Mysound.start(0);
};
stop();
and then then left all your code for the slider the same except for this bit at the begining.
theSound = new Sound(Mysound);
theSound.attachSound(Mysound);
Then you can dynamically load the music with buttons and control the volume of them.
However i need some one to come up with a visual preloader for the MP3 that is loading as online they could take a while and some indication that the sound is loading would be necersary.

Billy T
03-30-2003, 08:54 PM
Originally posted by avelives

theSound = new Sound(Mysound);
theSound.attachSound(Mysound);


what is this doing?

avelives
03-31-2003, 10:52 AM
basically i have just told your volume slider to use the variable Mysound , which is set by pushing the various buttons on the stage.
Try it! change the code on lines 15 and 16 inside the slider to this: theSound = new Sound(Mysound);
theSound.attachSound(Mysound);
and then create 3 buttons on main stage and attach the other peice of code i posted onto frame 1 of main timeline:
Note i used _level1 to target my 'Mysound' object cause it gets loaded into there. But chge the _level1 to relative path and obviously change the MP3 names as well.
Now dont get me wrong here im not saying its a great idea cause basically im not 100% on the exact code you made to create the vloume slider but this method i used seems to work, but please try it and tell me if im right or not??
I would send the SWF but problem is its too big!!