jinackman
08-08-2009, 11:47 AM
Hi
i have just followed a tutorial on random number which plays mp3 files, so if random number is 3 it plays sound file sound3.mp3 and so on.
the tutorial can be seen here
http://www.webdesign.org/web/flash-&-swish/flash-tutorials/sounding-random-with-flash-cs3.14609.html
the problem is when i click the button i get a different number but no sound, i keep getting this error.
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at sound_fla::MainTimeline/playSound()
i have loaded all the mp3 files into the libary can't seem to find the problem.
iam new to actionscript please help
here is my actionscript code.
button.addEventListener(MouseEvent.CLICK, playSound);
function playSound(e:Event)
{
SoundMixer.stopAll();
var num:Number = Math.ceil(Math.random()*4);
bigNum.text = num.toString();
var path:String = "sound" + bigNum.text + ".mp3";
var s:Sound = new Sound(new URLRequest(path));
s:play();
}
i have just followed a tutorial on random number which plays mp3 files, so if random number is 3 it plays sound file sound3.mp3 and so on.
the tutorial can be seen here
http://www.webdesign.org/web/flash-&-swish/flash-tutorials/sounding-random-with-flash-cs3.14609.html
the problem is when i click the button i get a different number but no sound, i keep getting this error.
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at sound_fla::MainTimeline/playSound()
i have loaded all the mp3 files into the libary can't seem to find the problem.
iam new to actionscript please help
here is my actionscript code.
button.addEventListener(MouseEvent.CLICK, playSound);
function playSound(e:Event)
{
SoundMixer.stopAll();
var num:Number = Math.ceil(Math.random()*4);
bigNum.text = num.toString();
var path:String = "sound" + bigNum.text + ".mp3";
var s:Sound = new Sound(new URLRequest(path));
s:play();
}