dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: multiple music clips

  1. #1
    Member
    Join Date
    Dec 2000
    Location
    Mesa, Az
    Posts
    86
    I have been working on this for several hours...
    I am trying to make a small cd player type thing that plays 3 songs [which have been choosen by me (not user selectable)]. I would like to make it possible to play, stop and cycle through those 3 songs, however, I am having difficulties. I am using the New Sound and attachSound commands.
    The problem isn't getting the music to play, but to get the right song to play. It is difficult to explain, easier to show.

    If anyone would like to help me and has AIM or MSNIM or we could do it through email, I would be really grateful.

    AIM: SecondClassCtzn
    MSNIM: stokertodd@hotmail.com
    Email: stokertodd@hotmail.com

    From there we could set up application sharing/netmeeting.

    Thanks
    Todds

  2. #2
    Member
    Join Date
    Dec 2000
    Location
    Mesa, Az
    Posts
    86
    any pointers?

  3. #3
    Member
    Join Date
    Dec 2000
    Location
    Mesa, Az
    Posts
    86
    From: http://board.flashkit.com/board/show...hreadid=349850


    I have a cd player type thing setup for my website. The users can select between 3 songs, and control with play, stop, pause, next song, previous song.
    Anyway, I have spent several hours trying to make this work, but no luck.

    I am using the following code to call up the music clips:

    var volPercent = 25;
    volumeText = volPercent + "%";
    volumeFill._xscale = 25;

    AD = new Sound();
    AD.attachSound("AD");
    AD.setVolume(volPercent * 2);

    WWYT = new Sound();
    WWYT.attachSound("WWYT");
    WWYT.setVolume(volPercent * 2);

    SIL = new Sound();
    SIL.attachSound("SIL");
    SIL.setVolume(volPercent * 2);

    Is that incorrect?
    I am doing linkage [exporting in the first frame].
    If i am doing anything wrong could somebody help me out.
    If there is no problem with the above, it is probably within the play button.

    The buttons which are used to keep track of which track the user is on basically add or subtract 1 to track [if the track isn't already at 1 or 3.] (track=track+1).

    Here is the code for the play button: (notice the if statements are centered around the "track.")

    ----------------------

    on (release){
    if (track = 1){
    AD.stop();
    WWYT.stop();
    SIL.stop();
    i=1;
    function timeme (){
    now = new Date();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    _root["nowtime"+i] = (Number(hours)*3600)+(Number(minutes)*60)+seconds;
    _root.newstarttime = _root["nowtime"+i] - _root.nowtime1;
    i++;
    }
    AD.start(_root.newstarttime, 10000);
    timeme();
    }

    else if (track = 2){
    AD.stop();
    WWYT.stop();
    SIL.stop();
    i=1;
    function timeme (){
    now = new Date();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    _root["nowtime"+i] = (Number(hours)*3600)+(Number(minutes)*60)+seconds;
    _root.newstarttime = _root["nowtime"+i] - _root.nowtime1;
    i++;
    }
    WWYT.start(_root.newstarttime, 10000);
    timeme();
    }

    else if (track = 3){
    AD.stop();
    WWYT.stop();
    SIL.stop();
    i=1;
    function timeme (){
    now = new Date();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    _root["nowtime"+i] = (Number(hours)*3600)+(Number(minutes)*60)+seconds;
    _root.newstarttime = _root["nowtime"+i] - _root.nowtime1;
    i++;
    }
    SIL.start(_root.newstarttime, 10000);
    timeme();
    }
    }




    ----------------------

    the date function is so they can pause and unpause...
    if anyone sees anything that could help, please tell me.
    If you wouldn't mind helping me out with the project, that would be awesome too.

    AIM: SecondClassCtzn
    MSNIM: stokertodd@hotmail.com
    email: stokertodd@hotmail.com



  4. #4
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    I will design you a fla to do a three sound player.
    I will post it my sight for you to download. ONLY YOU.
    I will send you an email with the link for you to download this fla. The 3 sounds will in mp3 format, and externally loaded, so that the fla remains small in size. This is for Flash MX. as I hope you are working with.
    All you have to do is change the sounds to your sounds and you're done.
    Is this ok with you?
    [Edited by EQFlash on 07-31-2002 at 10:07 PM]

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