Flash: JukeBox without XML - Collab'ed With Althorne (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


dominic_r_monroe -> Flash: JukeBox without XML - Collab'ed With Althorne (9/3/2008 13:58:03)

Welcome, This is my tutorial for making a jukebox. After reading Althorne's tutorial I noticed that the sound quality was unfortunately Lowered.
So after a while of searching I discovered some AS2 Code that would help !


quote:

//FRAME ACTIONS

var songID:String; //Declares the variable SongID a string value (text and numbers)

songInfo = new Array(); //Declares the variable songInfo an array
//ALL KEYS MUST BE DIFFERENT, BUT VALUES CAN BE THE SAME!!
songInfo["Key"] = "Value"; //An Example Value in the array with the key 'Key'. Duplicate the line, and change the key to one you like. Change the value on the variable to the FILENAME of your mp3 WITHOUT THE .mp3

loadSong=function(songID){ //Declares loadSong a function. When the function is run, a value for the variable SongID
stopAllSounds(); //Stops ALL Sounds
loadedSong = new Sound(soundLoader); //The variable loadedSong is a new sound. When a sound is loaded into it, it is given the instance name soundLoader
loadedSong.loadSound(songInfo[songID] + '.mp3', true); //Loads a song into the variable loadedSong. The name of the file is songInfo[theKeyYouGiveInTheButton] and it adds the string .mp3 to the end.
} //Ends the statement block


The script is pretty Much Self Explanitory. Add this to the frame. On a new layer called Actionscipt

//BUTTON ACTIONS

quote:

on (release) { //Executes The Following Block of Code When The Mouse Is Clicked
loadSong("Key"); //Runs the loadSong() function that is declared in frame 1. The "Key" refers to the key declared in the array on frame 1. Look there for full description
} //Ends code block

Yet again Very Self-Explanatory. Thanks to Althorne. He pretty Much just Array Versioned my script. :L.
Key = Song Name
Value = Name of .mp3.mp3 n the end is not required.

Now test your jukebox by hitting Control + Enter. Before exporting in flash. If wanted you could Add colours and other wonderful effects. I may Make an equalizer bar tutorial using the Mask Feature at a point.
But until Then Good Luck. Export as .swf. And put in the FOLDER Containg .swf and Music files

Notes: Now make sure the Sound files are in the same folder as the swf file. Remeber to rename nameofsongfile.mp3 from the code to what the .mp3 file is E.g Glamorous-LudacrisFtFergie.mp3.
If you try and upload The swf alone it will not work ! You must upload the folder. I know that BiG Frend was doing free hostin not long ago, contact him for details.

I will try and get my Jukebox up somewhere on the internet. I am planning on getting a new site.


Thanks to Althorne for contributing his Arrays Etc. TO my Tutorial !




The Illusive Man -> RE: Flash: JukeBox without XML - Collab'ed With Althorne (9/5/2008 11:04:14)

Whee! I helped!

I might try to add a list function to it, but no promises.




swenn -> RE: Flash: JukeBox without XML - Collab'ed With Althorne (9/5/2008 11:18:12)

Woah.. this I didnt know we had this advanced AS at the forums.. I will try this sometime^^




biG frend -> RE: Flash: JukeBox without XML - Collab'ed With Althorne (9/5/2008 11:18:22)

Using your method would not increase the filesize would it though? I just skimmed and haven't tried it but nice semi-tut.




dominic_r_monroe -> RE: Flash: JukeBox without XML - Collab'ed With Althorne (9/5/2008 11:21:36)

You Arent adding the MP3 to the file. Your still leaving it in the folder. [8D]




biG frend -> RE: Flash: JukeBox without XML - Collab'ed With Althorne (9/5/2008 11:36:51)

Well I assumed their was a quality loss would of caused a file size to fall as well.




dominic_r_monroe -> RE: Flash: JukeBox without XML - Collab'ed With Althorne (9/5/2008 14:44:25)

No. The quality was lowered because it was a .SWF. And the quality size was smaller once inside the .swf which was loaded externally.





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.125