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

  • Home
  • SEARCH
  • 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 1063077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:43:48+00:00 2026-05-16T18:43:48+00:00

I have some AS3 MP3 code that my teacher gave me a while ago

  • 0

I have some AS3 MP3 code that my teacher gave me a while ago and it loads perfectly when I load the site locally on my computer, but I uploaded the site to my server and the MP3 doesn’t load at all, but the rest of the site is fine. Since I’m not great at AS3 and don’t quiet understand everything that is going on I’m just going to post the MP3 code in its entirety just in case any of you can spot why it won’t load online. By the way I only bought the basic server space from bluehost.com. I did not purchase a media server (which I really don’t know what it does). Could this be the problem?

var songList:Array = new Array("InBackRoom.mp3", "NoMeansYes.mp3");
var isPlaying:Boolean = false;
var currentSong:Number = 0;
var song:Sound;
var channel:SoundChannel = new SoundChannel();
var xform:SoundTransform = new SoundTransform();

seekKnob.buttonMode = true;
seekKnob.addEventListener(MouseEvent.MOUSE_DOWN, seekStartDrag);
btnPrev.addEventListener(MouseEvent.CLICK, prevHandler);
btnPause.addEventListener(MouseEvent.CLICK, pauseHandler);
btnPlay.addEventListener(MouseEvent.CLICK, playHandler);
btnNext.addEventListener(MouseEvent.CLICK, nextHandler);
volumeKnob.buttonMode = true;
volumeKnob.addEventListener(MouseEvent.MOUSE_DOWN, volumeStartDrag);

function prevHandler(evt:MouseEvent):void {
    prevSong();
}

function pauseHandler(evt:MouseEvent):void {
    pauseSong();
}

function playHandler(evt:MouseEvent):void {
    playSong(channel.position);
}

function nextHandler(evt:MouseEvent):void {
    nextSong();
}

function id3Handler(evt:Event):void {
    songInfo.text = /*song.id3.artist + ": " +*/ song.id3.songName;
}
function soundCompleteHandler(evt:Event):void {
    pauseSong();
    nextSong();
}

loadSong(songList[currentSong]);

function loadSong(thisSong:String):void {
    song = new Sound();
    song.load(new URLRequest(thisSong));
    song.addEventListener(Event.ID3, id3Handler);
    /*playSong(0);*/
}

function playSong(position:Number):void {
    if (!isPlaying) {
        isPlaying = true;
        channel = song.play(position);
        channel.soundTransform = xform;
        channel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
        seekKnob.addEventListener(Event.ENTER_FRAME, seekKnobUpdate);
    }
}

function pauseSong():void {
    seekKnob.removeEventListener(Event.ENTER_FRAME, seekKnobUpdate);
    channel.stop();
    isPlaying = false;
}

function prevSong():void {
    if (currentSong > 0) {
        currentSong--;
        pauseSong();
        loadSong(songList[currentSong]);
    }
}

function nextSong():void {
    if (currentSong < songList.length - 1) {
        currentSong++;
        pauseSong();
        loadSong(songList[currentSong]);
    }
}

function seekStartDrag(evt:MouseEvent):void {
    pauseSong();
    seekKnob.startDrag(true, new Rectangle(seekSlider.x, seekSlider.y + seekSlider.height/2, seekSlider.width, 0));
    stage.addEventListener(MouseEvent.MOUSE_UP, seekStopDrag);
}

function seekStopDrag(evt:MouseEvent):void {
    seekKnob.stopDrag();
    playSong(song.length * (seekKnob.x - seekSlider.x) / seekSlider.width);
    stage.removeEventListener(MouseEvent.MOUSE_UP, seekStopDrag);
}

function seekKnobUpdate(evt:Event):void {
    var pos:Number = seekSlider.width * channel.position / song.length;
    if (!isNaN(pos)) {
        seekKnob.x = seekSlider.x + pos;
    } else {
        seekKnob.x = seekSlider.x;
    }
}

function volumeStartDrag(evt:MouseEvent):void {
    volumeKnob.startDrag(true, new Rectangle(volumeSlider.x, volumeSlider.y + volumeSlider.height/2, volumeSlider.width, 0));
    volumeKnob.addEventListener(MouseEvent.MOUSE_MOVE, volumeUpdate);
    stage.addEventListener(MouseEvent.MOUSE_UP, volumeStopDrag);
}

function volumeStopDrag(evt:MouseEvent):void {
    volumeKnob.removeEventListener(MouseEvent.MOUSE_MOVE, volumeUpdate);
    volumeKnob.stopDrag();
    stage.removeEventListener(MouseEvent.MOUSE_UP, volumeStopDrag);
}

function volumeUpdate(evt:MouseEvent):void {
    xform.volume = (volumeKnob.x - volumeSlider.x) / volumeSlider.width;
    channel.soundTransform = xform;
}

I checked and everything is uploaded and in the same, correct file structure that it should be.

  • 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-16T18:43:49+00:00Added an answer on May 16, 2026 at 6:43 pm

    It’s not necessary to use a media server. Use a web debugger such as Firebug to see if the requests for the MP3 files are being made, to where they are being made and if the response is appropriate. It might be something as simple as case sensitivity in the url.

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

Sidebar

Related Questions

I have an FLA done in Flash 10, and some AS3 code that manipulates
Okay getting some weirdness. I have a simple URLLoader in AS3 that loads an
I have some as3 code under development that I'd like to migrate to as2
I have some code that will change the background color of a specific label
I have some banner ads in AS3 that I need to make work with
I have an AS3 application that loads various SWFs at runtime. The loading animation
I've got some code written is AS3. My aim is to have the MainTimeline
Let's say I have some code like this in AS3 for(...) thing = new
I have a movie clip that holds one bitmap image, some simple AS3 to
I have some ActionScript code that splits a string using Regular Expression and lets

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.