I have a Android Actionscript project that I am trying to incorporate sound in, but having a problem that I cannot figure out. I have the sound file in the same directory as my class file and my .xfl file. I am trying to start the music file as soon as the application starts via class reference, but am getting the same error everytime:
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at playAudio()[C:\pathtoerror\playAudio.as:9]
at networkScores/frame1()[networkScores::frame1:7]
Here is my class file:
package
{
import flash.media.Sound;
import flash.net.URLRequest;
import flash.media.SoundChannel;
public class playAudio extends Sound
{
public var music:Sound = new Sound(new URLRequest("mathHomeSong.mp3"));
public var sc:SoundChannel;
public var num:int;
public function playAudio(controlNum:int)
{
num = controlNum;
if(num == 1)
{
sc = music.play();
}
else if(num == 2)
{
}
}
}
}
Here is my call from the timeline:
import playAudio;
var playMusic:playAudio = new playAudio(1);
Just figured this out, I had to put a link to the mp3 file in my server, instead of putting it in my directory.
Sorry about the confusion
I posted too soon. I just figured out my question, figures. Ok, so what I did not do is post this file on my server and with the URLRequest(“”); I had to put a link to my file on my server, not linki
The answer to this question is that I forgot to add this music file to a server and then link it via hyper link. For example http://mysite.com/audio.file
Sorry about this
thanks