View Full Version : Jukebox
Nick Toye
08-11-2004, 04:33 PM
Hi,
Ok, I'm looking for as much info as I can on this subject, because I don't think that it is covered in as much depth as it should be, well not that I can see, maybe i'm blind. Anyway. Seen as we are designing more for broadband now, music is to be a big player, sound shows emotions and I think sites have to have this extra dimension.
First of all:
What is the best way to put a complete song on a flash site. I have a client that requires the whole album to be accessible from their site. When I import a track from the album it, it comes in at 45 mb, when I save it as an MP3 I get it down to 2mb, and I can further compress it to around 250k in flash. Is there any other way of doing this?
Second of all:
Should I link to the tracks via an XML file, or have the jukebox play the track dynamically from the library, by linkage?
Finally:
Does anyone know of any good books or tutorials that will cover everything you need to know about creating good jukebox movies clips.
Many thanks in advance
friz2002
08-11-2004, 04:43 PM
Hi,
I put my .mp3's in seperate .swf files
In my main movie I have an empty movieclip where I load the .swf file with the mp3.
So when a button is pressed, the swf containing the song is loaded into the empty movieclip.
I compress the mp3 first in Cool Edit (now Audition).
Hope this helps
cEzmunsTa
08-11-2004, 04:55 PM
Hi Nick,
Using XML would have to obvious advantage of being easily modified.. whether you embed your MP3 in a SWF or use as is, is up to you. You could try using new Sound(), and create an instance of a sound object to load the file into.. you can access the ID3 tags of the files that way (eg. mySound.id3.artist).. not sure if you can when embeded, as I haven't tried it that way. Using getBytesLoaded() and getBytesTotal() should allow you to check whether the track should play..
Good luck
cEzmunsTa
08-11-2004, 04:57 PM
P.S. the id3 tags can only be accessed when the file has completely loaded.
TheBuzz
09-16-2004, 02:39 AM
Hey Nick,
I was doing a search on for jukebox's cause I am having problem with a counter and saw your thread, don't know if you have solved your problem or not but here is a solution. Since you said that you are relying on broadband, don't use xml or put in library with linkage. Either stream your songs or load them in and then play after load. So here we go.
1st things first, upload all your songs to your webserver cause you will be pulling the songs from there.
Now on the first frame of your jukebox swf you start off building a empty MC to hold your audio file on load. Doing so like this:
this.createEmptyMovieClip("mcSoundHolder", this.getNextHighestDepth());
var sndAudio:Sound = new Sound(mcSoundHolder);
Now you have a sound holder with a sound variable created inside of it. Now
create and onLoad function to handle once the song file has been loaded like this:
sndAudio.onLoad = function(bSuccess:Boolean):Void {
if(bSuccess) {
this.start();
};
Now you have a function that will check to see if your song is finished, so once you do that you have to load the songs. I like to use a button to retrieve the song, create a playlist MC with the songs you uploaded and give them some functions like this:
mcTrack1.onRelease = function():Void {
sndAudio.loadSound("http://www.yoursite.com/my_song.mp3", false);
myInterval = setInterval(checkProgress, 100);
};
In that function that false statement is for streaming so you can set it to true if you wish but I preload my songs using that setInterval line. Make sure you set your variable for it at the top of the code source like this:
var myInterval:Number;
Now since our interval is trying to check a function called checkProgress we should create one like so:
function checkProgress():Void {
var nTotal:Number = sndAudio.getBytesTotal();
var nBytes:Number = sndAudio.getBytesLoaded();
var nPercent:Number = Math.floor((nBytes/nTotal)*100);
tLoaded.text = nPercent + "% has loaded";
}
if you have a dynamic text field set up somewhere in the jukebox called tLoaded you will have a nice preloader for your songs.
Furthermore, set up some buttons to control the sound now that it is loaded and running once the download is complete. I will name my buttons mcPlay, mcPause, and mcStop.
mcPlay.onRelease = function():Void {
sndAudio.stop();
sndAudio.start(sndAudio.position/1000);
};
mcPause.onRelease = function():Void {
sndAudio.stop();
};
mcStop.onRelease = function():Void {
sndAudio.stop();
};
This much should be able to get you started with your jukebox, if you are interested in how I labeled my song for display and further more just ask:)
farafiro
09-16-2004, 06:32 AM
the best ever sound tut "MX"
http://www.kennybellew.com/
wahhhhhhh, too old thread
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.