Copy link to clipboard
Copied
how to code a button to play and pause sound using load sound?I have used load sound methos to attach the sound.Can anyone help me?
i can't determine where the sound is defined and where you're trying to control it. this will work but is sloppy coding:
stop();
adaDrut1.onRelease = function () {
_root.mySoundC = new Sound(this);
_root.mySoundC.loadSound("F#/Bhajni1.ark", true);
_root.mySoundC.onSoundComplete = function() {
this.start(); }
gotoAndPlay("play2");
_global.myTaalLaya = "Low1";
}
play_btn.onRelease=function(){
_root.mySoundC.start();
}
pause_btn.onRelease=function(){
_root.mySoundC
...Copy link to clipboard
Copied
after loading is complete you can use your sound instance's stop() and start() methods. if you don't understand that sentence, copy and paste the code you use to load your sound.
Copy link to clipboard
Copied
Hey thnx,
I have used this code on sound's button's frame.and my stop n play button is on another screen.main sound button and stop button is on diffrent screen.
Here is my code-
stop();
adaDrut1.onRelease = function () {
mySoundC = new Sound(this);
mySoundC.loadSound("F#/Bhajni1.ark", true);
mySoundC.onSoundComplete = function() {
_root.mySoundC.start(0,999); }
gotoAndPlay("play2");
_global.myTaalLaya = "Low1";
}
adaDrut1 is a sound button.And there are lot of buttons with diffrent sound.
Thanks..
Copy link to clipboard
Copied
stop();
adaDrut1.onRelease = function () {
mySoundC = new Sound(this);
mySoundC.loadSound("F#/Bhajni1.ark", true);
mySoundC.onSoundComplete = function() {
this.start(); }
gotoAndPlay("play2");
_global.myTaalLaya = "Low1";
}
play_btn.onRelease=function(){
mySoundC.start();
}
pause_btn.onRelease=function(){
mySoundC.stop();
}
Copy link to clipboard
Copied
thnx but not working
.I have applied play n stop btn code on play n stop btn.is it fine or i have applied it at wrong place?
Copy link to clipboard
Copied
i can't determine where the sound is defined and where you're trying to control it. this will work but is sloppy coding:
stop();
adaDrut1.onRelease = function () {
_root.mySoundC = new Sound(this);
_root.mySoundC.loadSound("F#/Bhajni1.ark", true);
_root.mySoundC.onSoundComplete = function() {
this.start(); }
gotoAndPlay("play2");
_global.myTaalLaya = "Low1";
}
play_btn.onRelease=function(){
_root.mySoundC.start();
}
pause_btn.onRelease=function(){
_root.mySoundC.stop();
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now