Copy link to clipboard
Copied
I am trying to play a sound file from the library.It is going to play when the button is pressed. I have the following script:
on (press) {
var ses:Sound = new Sound();
ses.loadSound("Kalimba.mp3", true);
}
Kalimba.mp3 is a file imported to library. But I always get this error:
Error opening URL 'file:///C/Users/.../Desktop/Kalimba.mp3'
Why do I get this error? Can anyone please help?
Best,
Cagri Kasap
Copy link to clipboard
Copied
Take a look at this tip. FlashCC, HTML5 canvas Beispiele, Tutorial, Hilfe Anleitung you have to import the sound in the library and give him a class Name. You can put the javascript in a Keyframe like this. createjs.Sound.play("Blub", createjs.Sound.INTERRUPT_EARLY, 0, 0, loop);
"Blub" is the class name of the sound.
Copy link to clipboard
Copied
that file is not found at that location.
ie, Kalimba.mp3 is not on your desktop.
Copy link to clipboard
Copied
If you are using AS2 and the sound file is in the movie's Library, then you should have given that imported sound file an instance name. You then want to use that instance name with attachSound(instanceName) to connect the sound file with the Sound object. Here's a good tutorial that may help to expain in detail: kirupa.com - Playing Sounds in ActionScript