Copy link to clipboard
Copied
I am facing a problem with audios.
I am putting to execute a certain audio in .mp3 in a button event (click), however, just by me testing the movie (ctrl + enter) the sound is already exited without the need to press the button.
I have already tried to use the instance.pause or .clouse ... But to no avail.
Could someone give a solution? Thanks in advance!
import flash.events.MouseEvent;
stop();
var TEST:green = new green ();
button1.addEventListener(MouseEvent.CLICK, soundTest);
function soundTest (Event:MouseEvent) {
TEST.play();
}
Copy link to clipboard
Copied
Hi.
Probably the green class is playing the sound when it is instantiated.
Can you check this? Or maybe you could show us the code of this class.
Regards,
JC
Copy link to clipboard
Copied
I took green() to be the sound, not a class that is playing the sound.
Do you have. copy of the sound in the timeline? Failing that, work around the problem by making the sound when it's first played, like:
import flash.events.MouseEvent;
stop();
var TEST:green;
button1.addEventListener(MouseEvent.CLICK, soundTest);
function soundTest (Event:MouseEvent) {
if(TEST==null) TEST = new green();
TEST.play();
}
Copy link to clipboard
Copied
The problem has not been solved, even by applying the method described.
Accidentally, I accessed a small panel that asked how I would want this audio, among the options were:
> Start
> Loop
> Stop
I chose to stop and the problem was solved, but I do not know where to find the panel. Would you help me?
Copy link to clipboard
Copied
Would you mind sharing your FLA?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now