A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: mp3 player

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    25

    mp3 player

    Hi everyone and apologies for my English, this is my question (AS2):

    I'm currently working on a mp3 player, 3 tracks, so 3 frames with:
    Code:
    s = new Sound();
    s.loadSound("url", true);
    stopped=false;
    paused=false;
    stop();
    The next and previous buttons code is respectively:
    Code:
    on(release) {
    	s.stop();
    	nextFrame();
    }
    and
    Code:
    on(release) {
    	s.stop();
    	prevFrame();
    }
    But I'd also would like that, if I press the "next" button while the last track (last frame, so frame 3) is playing it starts playing track 1 (on frame 1).
    In other words if the current frame is the last frame, then go to and play frame 1. Same for the "previous" button.

    Sorry, hope it makes sense, thanks in advance.

    Also, at the moment when it has played one track it stops, wondering if it was possible to make it play all of them and then back to the first without pressing any button?

  2. #2
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Try naming your 1st frame "Track1" and on the btn action in your 3rd frame, replace nextFrame(); by gotoAndStop("Track1");
    That would solve your first problem I think (I would also advice to name the other frames too, maybe it will come out handy in the future ...).

    Florian
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  3. #3
    Junior Member
    Join Date
    Dec 2004
    Posts
    25
    Heehee but of course! Me silly, thanks SO much!

    Second problem anyone?

  4. #4
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    s.onSoundComplete = function() {
    this/_root.gotoAndStop(blahblah);
    }

  5. #5
    Junior Member
    Join Date
    Dec 2004
    Posts
    25

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