|
-
Who needs pants?
Load Mp3 File ?
I was wondering if you can load a mp3 file instead of nesting it into a a external swf. What i have is a mp3 player that loads the external swf's into a blank mc which contain the mp3's. And one more question just say i have a swf and on the main time line i have draged accreoss the mp3 to the stage and extended the timeline to the length of the mp3 how would that load. Would it play every five seconds of the song or would it just wait.
ThankS in Advance
[h]ooligan
-
use loadSound() to load native mp3 into Flash 6.
sounds on a timeline set to stream sync play for as many frames as you assign to the sound's key frame or until the sound finishes if the number of frames exceeds the song's length.
sounds on a timeline set to event/start sync and looped will continue to play even after the graphic playhead stops.
-
Who needs pants?
i dont know much about loading mp3 files. Would you be able to give me an example? And what capabilites does loading an external mp3 file have and can you tell what percent the file has loaded. Can you pause the mp3?
ThankS in AdvancE
-
Kenny Bellew's sound object tutorial has some good examples and tips on dealing with native mp3 through sound objects.
www.kennybellew.com
-
Use .getBytesLoaded and .getBytesTotal to get a percentage loaded. By getting sound.position before you pause, you can restart your sound from this value.
Peter
-
Who needs pants?
hp3: Thanks for that i really appretiate it, its a great link.
schmeete: Thanks.
-
Who needs pants?
Ok i have decided to start over with my mp3 player. It was going well and was really dynamic but i was loading full swfs with the mp3 in it into the flash player.Which means the swf files where fairly large and that means a longer wait time. Ok so i have decided to start agian and use dynamically loaded mp3 files. So im going to take this step by step and post a new question when trouble arrises. The first problem that i have some accorss is updating the song lists. My mp3 player has a total of 10 tracks so far what i want is to create a sound object with all 10 sounds in it is that possible. Here's what i have so far.
Code:
song1=new Sound();
song1.attachSound("song01");
song2=new Sound();
song2.attachSound("song02");
song3=new Sound();
song3.attachSound("song03");
song4=new Sound();
song4.attachSound("song04");
song5=new Sound();
song5.attachSound("song05");
song6=new Sound();
song6.attachSound("song06");
song7=new Sound();
song7.attachSound("song07");
song8=new Sound();
song8.attachSound("song08");
song9=new Sound();
song9.attachSound("song09");
song10=new Sound();
song10.attachSound("song010");
how can i make this simpler ?
-
its not very clear from your post what you are trying to do.
1) sound only SWF are not significantly different from native mp3 in file size so do not assume that mp3 will be a more bandwidth efficient delivery compared to sound only SWF.
2) if you plan on using native mp3, you must use loadSound() to conect a sound to a sound object. attachSound() is for mp3 included within a SWF.
3) sound objects can only hold one sound at a time.
do you want your users to load one sound a at time or do you want all sounds loaded before user starts playing music?
-
Who needs pants?
Ok i got what i was trying to do work . Yipee. Ok now 2 more questions.
1.I want to switch to the next track once it has reached the end of the mp3 file. I can switch between the tracks with my next button i can do that fine. All i want to know how to do is. How do i detect when an mp3 file has finished playing so i can move to the next track ?
2.Another thing is how do i make a play head. To show how much of the song has played and what left. Also can you detect the length of the mp3 file eg song one is 2:45 long and can you show where it is up to eg 1:30 of 2:45.
ThankS in AdvancE
-
Who needs pants?
i worked out the answer to my first question it was simeple.
Code:
myMusic.onSoundComplete = function() {
next();
}
when the song is finished run my next function 
But i still need help with my second question 
ThankS in AdvancE
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|