• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

ArgumentError: Error #2068: Invalid sound. at flash.media::Sound/play() at animacion2_copia_fla::M

Community Beginner ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

import flash.media.Sound;
import flash.media.SoundChannel;
button_9.addEventListener(MouseEvent.CLICK, resumeSound);
var sonido1: Sound = new Sound(); 
var soundChannel: SoundChannel;
function resumeSound(event: MouseEvent): void {
if (!soundChannel) {
soundChannel = sonido1.play();
}}
kathe37922242rzrk_1-1717863983411.pngkathe37922242rzrk_2-1717864096855.png

Pueden ayudarme? nose porque sucede este error

se supone que la dar click en el boton deberia seguir reproduciendo el audio pero no lo hace nose que estoy haciendo mal,  Estoy trabajando en adobe animate 2023 

Views

215

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

correct answers 1 Correct answer

Community Expert , Jun 08, 2024 Jun 08, 2024

Hi.

Adding to k's answer, the sound declaration should be something like:

var sd:sonido1 = new sonido1();


In your case, you're using sonido1 as the variable name but you should use as the class name.

Regards,
JC

Votes

Translate

Translate
Community Expert ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

do you have a sound in your library that has a class assigned?  if so use it, not new 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 Beginner ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

si el sonido es: sonido1 

kathe37922242rzrk_0-1717865864546.png

pero no se reproduce al dar click en el boton 

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 Beginner ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

este es actionScript del sonido 

kathe37922242rzrk_0-1717866052635.png

cuando le doy a aceptar para guadar cambios me aparece este mesaje es normla? 

kathe37922242rzrk_1-1717866129053.png

 

 

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 ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

Hi.

Adding to k's answer, the sound declaration should be something like:

var sd:sonido1 = new sonido1();


In your case, you're using sonido1 as the variable name but you should use as the class name.

Regards,
JC

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 Beginner ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

una ultima pregunta si quiero hacer que el sonido se reprodusca es correcto utilizar esta funcion

function resumeSound(event: MouseEvent): void {
if (!soundChannel) {
soundChannel = sonido1.play();}}

kathe37922242rzrk_0-1717867542933.png

 

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 ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

Now you have to use the variable name. In the example I gave, It would be sd.play();.

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 Beginner ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

si, me di cuenta de eso muchas gracias, pero aun no se reproduce el audio por alguna razon :c, aunque ya no me sale ningun error 

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 ,
Jun 08, 2024 Jun 08, 2024

Copy link to clipboard

Copied

LATEST

browser's block sound unless there's user interaction, eg a mouse click.

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