Copy link to clipboard
Copied
Hello,
I know this question has been asked before but I am not getting any results from the previous answers. My code is very simple, not even complete yet. This is actually a tutorial I am following for class. My instructor sent us mp3 files to download and I keep getting this error:
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error. at MP3_Player_fla::MainTimeline/frame1().
I have already read that one solution someone had was to change text behavior from multiline to single line and that fixed it. Well in static text, the behaviors are set to multiline and greyed out. My coding is below, someone please help me!!!
import flash.net.URLRequest;
import flash.media.Sound;
import flash.events.Event;
var audioLoader:URLRequest = new URLRequest ("carmina");
var s:Sound = new Sound();
s.load(audioLoader);
s.addEventListener(Event.COMPLETE, songReady);
function songReady(evt:Event):void {
trace("song ready");
}
Hi.
This error is not related to text fields or text fields types. The error is saying that the path to the song you're trying to load is wrong. In your case, you're missing the extension. Also, you're missing a play call.
Try this:
...import flash.net.URLRequest;
import flash.media.Sound;
import flash.events.Event;
var audioLoader: URLRequest = new URLRequest("carmina.mp3"); // ADD THE EXTENSION HERE
var s: Sound = new Sound();
s.load(audioLoader);
s.play(); // ADD THIS LINE
s.addEventListener(Event.COMPLET
Copy link to clipboard
Copied
Hi.
This error is not related to text fields or text fields types. The error is saying that the path to the song you're trying to load is wrong. In your case, you're missing the extension. Also, you're missing a play call.
Try this:
import flash.net.URLRequest;
import flash.media.Sound;
import flash.events.Event;
var audioLoader: URLRequest = new URLRequest("carmina.mp3"); // ADD THE EXTENSION HERE
var s: Sound = new Sound();
s.load(audioLoader);
s.play(); // ADD THIS LINE
s.addEventListener(Event.COMPLETE, songReady);
function songReady(evt: Event): void
{
trace("song ready");
}
Regards,
JC
Copy link to clipboard
Copied
Thank you soo much! Just adding the extension made the difference! My instructor stated to copy the name of the file exactly how it was so that's what I did. Words are very powerful if not used correctly. Thanks a bunch for your help though!!
Copy link to clipboard
Copied
Excellent!
You're welcome!