A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Jukebox in flash :HELP!: LOL

  1. #1
    Junior Member
    Join Date
    Dec 2005
    Posts
    21

    Jukebox in flash :HELP!: LOL

    For the past two years I have been trying to create something like this http://www.niveafan.com/player_sampler.swf in flash. I do not know where to begin or anything because I have not done any flash whatsoever, can someone help me please

  2. #2
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    i'll create a sample player for you. the sounds will be dynamically loaded to descease fla size. It will come in a zip file. What version of flash are u using?
    If you don't think you're going to like the answer, then don't ask the question.

  3. #3
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Hey,

    Well you would start by getting a few songs and importing them into your library. Now , prepare yourself for a long tutorial!

    *Stretches*

    Setting up the buttons
    Ok first step is to set up the buttons. For now just make the "next" button since its the main button people will be using , the others are just extra

    Where do you put it? , on the first frame of your timeline.

    Setting up the movieclips for the songs
    Now you have to put your songs somewhere, and that somewhere will be in a movieclip.

    1) Start by making a blank movieclip , hit Ctrl-F8 and select the movieclip option. Give it a name of something like 'songs'

    2) Drag this movieclip onto you stage (frame 1 still) and give it an INSTANCE name of 'songs' (without the qoutes of course). Instance names are what your refer to something in code

    3) Open up this movieclip now, double click it from the library. You will notice it takes you to another timeline

    Just a note about movieclips, they have their seperate timeline so you can animate them and do all sorts of crazy stuff

    4) Anyways, on the first frame of this new movieclip, open up the actions panel (where all the code goes) by clicking the first key frame and hitting F9. Place the code: stop();

    This is so the movieclip stays on its first frame until you tell it to go somewhere else

    5) Now click on frame two of that movieclip and make a new keyframe (F6). Think of a keyframe as a part of the timeline where something new happens, and in this case playing a song.

    Now simply drag ONE of your songs from the library onto that keyframe and click 'yes' when it asks you if you want to expand the song out.

    6) Now you have to name the keyframe for good measures. Click on frame 2 (the beggining of the first song) and at the bottom where the properties panel is, change the label to 'song1'

    7) Now for song two you would do the same. Click on the frame AFTER the last one and make a new keyframe, drag the second song out, click yes, give it a new name and all that jazz

    Do the same for the other 3 songs

    Where is the code!?
    Well now its time to put the most important part, the code.

    1) With your song movieclip still opened, click on the end key frame of the first song and open the actions panel again (F9). Simply put the line:
    gotoAndStop(1);

    That will just go to the beggining of this song movieclip where nothing is therefore stopping the song when its done

    Do the exact same at the end of the other four songs

    2) Now get out of the song movieclip and onto the main timeline where all your buttons are, its time to code them

    3) Actually I lied, we have to code something first *ahem*. Click on the first frame of the timeline and open the actions panel there (F9). Place the code:

    code:
    counter = 0;



    We just made a variable. The counter is just for the purpose of knowing what song your on

    4) Ok now click once on your next button and open the actions panel for it. Place this code:

    code:
     on (release){
    _root.counter ++;
    if (counter == 1){
    _root.songs.gotoAndPlay("song1");
    }else if (counter ==2){
    _root.songs.gotoAndPlay("song2");
    }else if (counter == 3){
    _root.songs.gotoAndPlay("song3");
    } else if (counter == 4){
    _root.songs.gotoAndPlay("song4");
    _root.counter = 0;
    }



    So basically, when you hit the next button, the counter variable we made is incremented by 1. If it equals one, then the movieclip you made with all the songs on it (the one with the instance name of 'songs') goes and plays the frame called "song1". Remember "song1" was the label we gave the first song. If you used something else, change "song1" to whatever you had.

    Notice on the else if (counter == 4){ I set _root.counter back to 0. Thats because since song 4 is the last song, it has no where to go. So by setting it back to 0, it will increment back to one therefore starting from the first song.

    This is assuming you have 4 songs, if you have more, just add 'song5' , 'song6' onto the if statment. Be sure to but the _root.counter=0 code on the LAST else if statment

    *phew*

    Umm ...

    Yup that should be it , I hope that gets you started and good luck

  4. #4
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    If you don't think you're going to like the answer, then don't ask the question.

  5. #5
    Junior Member
    Join Date
    Dec 2005
    Posts
    21
    thank u but the fla file wont open

  6. #6
    Junior Member
    Join Date
    Dec 2005
    Posts
    21
    up

  7. #7
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    what version of flash are u using
    If you don't think you're going to like the answer, then don't ask the question.

  8. #8
    Junior Member
    Join Date
    Dec 2005
    Posts
    21
    Quote Originally Posted by EQFlash
    what version of flash are u using
    Flash MX 2002

  9. #9
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    If you don't think you're going to like the answer, then don't ask the question.

  10. #10
    Junior Member
    Join Date
    Dec 2005
    Posts
    21
    Quote Originally Posted by EQFlash
    It is still saying unexpected file format

  11. #11
    Learning and growing
    Join Date
    Dec 2005
    Location
    NY
    Posts
    55
    Go and download the new flash 8 demo for 30 days and open the file. then save it as an older format. on high speed internet, the download should take about 10 min. See if that works for you.

  12. #12
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    IAMN, do what NITRO1250 says, then you can open the first one i sent to you. the 30 day trial is free.
    If you don't think you're going to like the answer, then don't ask the question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center