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 6565181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:03:43+00:00 2026-05-25T14:03:43+00:00

I have 2 buttons in my AS3 project that load .mp3 files and then

  • 0

I have 2 buttons in my AS3 project that load .mp3 files and then play them. I have 2 buttons that switch between those files that aren’t working. I get an error saying:

Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful.
    at flash.media::Sound/_load()
    at flash.media::Sound/load()
    at player_fla::MainTimeline/playMusic1()

I’m thinking that means the file isn’t loaded before it tries to play, is that right? How can I check to see if the file is loaded before playing?

Here is my code:

function playMusic1(evt:MouseEvent):void{
        channel.stop();
        channel2.stop();
        songPosition = 0;
        var soundFile2:URLRequest = new URLRequest("http://r.jaxna.com/mp3Player/slushy.mp3");
        myMusic2.load(soundFile2, myContext);
        channel = myMusic.play(songPosition);
        channel2 = myMusic2.play(songPosition);

        }



function playMusic2(evt:MouseEvent):void {
        channel.stop();
        channel2.stop();
        songPosition = 0;
        var soundFile3:URLRequest = new URLRequest("http://r.jaxna.com/mp3Player/kingRight.mp3");
        myMusic2.load(soundFile3, myContext);
        channel = myMusic.play(songPosition);
        channel2 = myMusic2.play(channel.position);
  • 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-25T14:03:43+00:00Added an answer on May 25, 2026 at 2:03 pm

    Sound files load asynchronously in Flash. Listen for the Event.COMPLETE event and in that event handler, add code to check if both are loaded and then play.

    an example:

    //Before you load,
    myMusic2.addEventListener(Event.COMPLETE, musicLoaded);
    
    
    //Event listener
    private function musicLoaded(e:Event):void {
          //play logic here
          channel = myMusic.play(songPosition);
          channel2 = myMusic2.play(channel.position);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Flash AS3 project that loads external SWFs and controls them in
I want to have buttons that kind of act like tabs - they switch
I have buttons on a page that look like: <p> <a href=view.php> <input type=button
I have five buttons on one form that when clicked enables a bool each
I have two buttons that moves a movieclip up/down the Y-axis. How do I
I have 5 buttons and I need to iterate over them to carry out
I have a form in as3 flash with textfields and radio buttons with their
I have a menu that is built using its own AS3 class, when a
I need a button in Flash/AS3 that toggles between on and off. So I
I have a Flash (AS3, CS3) piece that has a button that will make

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.