Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sound Control 4

Status
Not open for further replies.

llldnylll

Technical User
May 21, 2003
89
Newbie here...

I made a control panel with a Play, Stop, FForward and Reverse button. I want to add 3 different tracks to choose from. How do I add the Action Scripts for it to work? If some one can point me in the right direction I would appreciate it.
 
All you ever wanted to know about sound, but were afraid to ask!


Regards,

cubalibre2.gif
 
...Thanks,


I am stuck once again... How do i make the mp3 small enough to play quick but sound good.

My mp3, at 16kbit sounds good but file is too big and at 8kbit small file but sounds horrible.

Is there a program that can help?

 
as long as you are streaming the mp3 in from an external source then the size dont matter,
 
Why when i select "Stream" the music doesn't play, but when i select "Event" everthing works fine.
What am i doing wrong?
 
you have imported the file into flash and are playing it on a frame. your file will be huge.

there is no need to do this. if you leave the mp3 in the same folder as the swf then the code i first posted will work fine.
 
lol

didnt post any code

mysound = new sound();
mysound.loadSound("my.mp3",true);
mysound.start();

all to go in first frame of movie
 
Thanks again... You da man!

What would the code be if i wanted to have 2 mp3's.
 
to build up a playlist of 2 or more you might be best to use a listbox or a combobox and add the titles there.

you can then get at the user selection through the change handler and getSelectedItem and load the appropriate mp3.

drag a listbox or combobox onto the stage and give it an instance name (eg mylist). add the song titles as labels and the mp3 names as data.

add this to the maintime line

mylist.setChangeHandler("SelectItem");

function SelectItem(){
mysound.stop();
mysound = new Sound();
var music = mylist.getSelectedItem().data;
mySound.loadSound(music + ".mp3", true);
mySound.start();
}
 
Im kinda confused on setting up a combobox.

Can you check out what i have so far and let me know if what im trying to do is doable or not??

I have the first song fine but the second one wont play...

 
Billwatson, Oldnewbie THANKS!

That worked!
 
When you initally posted this problem, although you had included the mp3s in the project, seemed to me you wanted to dynamically load those mp3s and stream them, which to me was a better solution, since your .swf is now over 1MB, and for slow connected users, this is going to take quite some time to download.
As for your preloader, the way it's coded, it won't ever work. A preloader is basically a loop that checks to see if some condition is met. In your preloader there's no loop. So minimally you would at least have to add a second frame to your preloader, so that it loops until the condition is met...

gotoAndPlay(1);

But since Bill used the attachSound action, rather than the loadSound one, and although the preloader might still be working, it will not display properly until all mp3s have downloaded on the first frame. One workaround is to create a new preloader only movie, which only prupose in life, is to preload your present file, without it's own preloader.

Furthermore, if you ever load this player, in another main movie, my guess is that the sounds wouldn't play anyways, because the sound objects' definitions are not properly coded and set.

Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top