Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7007325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:35:33+00:00 2026-05-27T21:35:33+00:00

I am working with AS3 to build a very simple mp3 player on my

  • 0

I am working with AS3 to build a very simple mp3 player on my site. So far the play and pause button work fine, but when I try to move the slider then click the pause button, it doesn’t pause, and then clicking the play button again causes it to play a new file.

I’m assuming that for some reason when I call the playMp3 function from my MouseEvent, it’s within an object or something and not at the root, so it’s like loading a new sound file, but I don’t know how to fix that.

Here is my code, any other suggestions about my code are welcome, I’m a noob at this and always looking for a better way to do things:

http://pastebin.com/uN8QFanX

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:35:34+00:00Added an answer on May 27, 2026 at 9:35 pm

    looks like your problem is caused by MOUSE_UP event.

    On pickupSlider function you add:
    parent.addEventListener(MouseEvent.MOUSE_UP, dropSlider);

    but on dropSlider function you only remove listener for MOUSE_MOVE so MOUSE_UP will keep caling dropSlider function. If you’ll add:
    parent.removeEventListener(MouseEvent.MOUSE_UP, dropSlider);
    in your dropSlider function it should be working fine.

    //TIP
    You don’t have to add CLICK listener each time in playMp3 and pauseMp3 function if you never remove them. You can add both of them at start and keep adding/removing buttons when needed (or use .visible true/false instead). Listeners are still attached to objects even if they are removed from stage. It’s importatnt, because if someday U’ll want to remove object and leave listeners to it garbage collector won’t take it and U’ll have memory leaks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm streaming an MP3 file in AS3. All is working fine (I can play
Hi i m trying to implement a simple button on my as3. but this
I have a working AS3 project and it compiles fine to a SWF. I
can someone help me understand this because it's working in as3 but not so
Usually i am pretty good at working my way round as3 but this one
I'm working in AS3, but I guess this could be a general question, so
I'm working on a AS3/AIR based project, I'm using FDT5 as main tool, but
I've been working on a framework in AS3 that I want to release, but
So I have a working Flash player using Cloudfront, AS3, NetConnection & NetStream. Works
I have a Regex in AS3. Until now it's been working, but now I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.