Hi everyone. This is my first post here! Been reading a lot of stuff on this site and in this forum and thought that it seemed like a nice place to post a problem of mine.
So here’s my problem, I’ve just started learning as3 and currently trying to make soundplayer that streams sounds and gets the soundpath via an xml. The problem is that I’ve started writing everything as external classes but I really don’t have enough experience to make it working. I managed to get it working by writing everything 100% timeline scripted though.
Anyways, I have a class for my play button in which I have all the code for the sound streaming and mouse event for the button.
This is what error I receive:
“Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.”
Here is what my class for the playbutton looks like:
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.net.*;
public class PlayButton extends MovieClip
{
public var snd:Sound = new Sound();
public var req:URLRequest = new URLRequest("mp3/sound.mp3");
public var context:SoundLoaderContext = new SoundLoaderContext(8000, true);
function PlayButton( ) {
addEventListener( MouseEvent.MOUSE_UP, PlaySound );
buttonMode = true;
trace("function PlayButton in PlayButton class");
snd.load(req, context);
}
private function PlaySound( e : MouseEvent ) : void {
trace("play");
}
}
}
Any suggestions? Thanks!