• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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();

Community Beginner ,
Feb 17, 2016 Feb 17, 2016

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

TOPICS
ActionScript

Views

791

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 17, 2016 Feb 17, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2016 Feb 17, 2016

Copy link to clipboard

Copied

that file is not found at that location.

ie, Kalimba.mp3 is not on your desktop.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 17, 2016 Feb 17, 2016

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines