ActionScript 2.0 :: Control Sound With Play And Stop Buttons?
Mar 29, 2004
I am trying to control Sound with actionscript and play and stop buttons.
This is the script I have in frame one of my scene.
[Code]...
playB is the instance of the play button stopB is the instance of the stop button the sound intro is on its own layer and is selected as a streaming sound. My problem is that when I stop and start the sound with the buttons the sound starts from the beginning instead of playing from the frame it is in.
View 3 Replies
Similar Posts:
Jan 17, 2007
I am trying to make a play, pause and stop btns controlling a mp3 file which is in the library which has a linkage id of Speakers. I've manage to get the pause and play to work but now incorporating a stop button isn't working for me
Code:
var snd:Sound = new Sound();
snd.attachSound("Speakers");
btnHalt.onRelease = function() {
snd.stop();
} btnResume.onRelease = function() {
snd.start(snd.position / 1000);
} restartbtn.onRelease = function() {
snd.start();
}
To say basically if you have pressed the pause btn, then the play btn, play from state pause at, but if you have pressed the stop btn then pressed the play btn, play from start and also if the play btn has been pressed and the audio is playing if pressed again dont play again do nothing.
View 5 Replies
Feb 13, 2007
i want to make a single button to play a sound, and if pressed again, stop the sound. and if pressed again, play the sound, and so on...
i know it has to be made with a boolean variable, true/false, but i just can't figure out how.
View 13 Replies
Apr 10, 2009
I have a scene with a voice over. I have split the voice over in to multiple sound files (mp3). The voice over plays correctly as long as you don't use the btns. When the forward btn is used the the file goes to the correct frame in the timeline but won't play the sound. Next issue, after pausing then using play the scene plays but without sound.
[Code]...
View 5 Replies
Oct 24, 2009
I'm just getting into learning ActionScript, I'm using 2.0 for the time being. Anyways, I know how to get clicking buttons to control the sound, but mostly that has just been a matter of muting with the "stopallsounds" function. What I wanted to know is if it is possible to get the keyboard to set the volume at 20%. For example, when you him the "down" arrow key, it goes down to 20% volume automatically.
View 1 Replies
May 12, 2009
I have to buttons that control the volume. They work fine just that I want to stop when the volume hit 100 and also when you go down to stop at 0. Right now it will go up and down then start the opposite way. I am not quite sure how to stop that(with a if statement).
[Code]...
View 1 Replies
Aug 19, 2010
I have a movie clip on the main timeline with an instance name odometer_mc. nested in that mc there are seven movie clips, two are named m100_mc, and km1_mc. I want to get km1_mc to play when m100_mc gets to frame 20.
View 4 Replies
Apr 19, 2010
I finally found out how to make my own sound control buttons but the problem is i'd really like the sound to start up when the flash movie loads and then use the stop and resume button to control it? But when I place the sound on a layer and then click the resume button the sound begins again and is echoed?
View 1 Replies
May 22, 2009
I have created some functions to manage timed pause/play in an animation and I am trying to make a class from them, but it does not work, the play() and stop() functions I use have no effect. The functions work as intended when not in the class.
Here is my code:
package anim {
import flash.utils.Timer;
import flash.events.TimerEvent;
[Code]...
I checked that the functions are executed with the trace() and it is the case, so the problem really comes from the play() and stop() functions, and I do not receive any error at compilation or runtime.
View 5 Replies
Jun 18, 2009
I want to control my animation with a play and stop button .
View 1 Replies
Aug 31, 2009
needless to say, new to as3... What I want to do is control start and stop of stage playhead with keyboard control. What I have so far is the stop control, but cant figure out the play. I have tried setting a var and boolean, but am doing something wrong =(
// heres my code
[Code]....
View 2 Replies
May 17, 2003
I want to use a sound loop in my flash movie. The movie has many scenes. And the problem is that when I go to next scene or different scene I hear the sound repeating twice. I mean sound does not stop from first scene and begins from the different scenes.Is there any way to play sound like "stop all sound" option in Flash.
View 6 Replies
May 2, 2006
I made to player with only the buttons play and stop, I tried to make that button toggle, but I did not works, then I made two buttons, when I click in play it shows a button and hides the other and vice versa, he functions normal, my problem is the following one:
When finishes the music the button not return for stop button, it continues showing to the animation of the play button , How can I make when to finish the music the button comes back to the state where it was.
[Code]...
View 2 Replies
Sep 4, 2010
Stop a sound then play another then back to it ?look at the Attachments files
View 2 Replies
Jan 27, 2011
When you click the first time on the button, it should start the song, when you click a second time on the button, it should stop the song. how do i make this with actionscript 3?
View 1 Replies
Jan 11, 2010
I have 2 samples that play with a click on a button, however, I want one of them to stop playing if the other one is played; so that only one sound will ever play at any one time.
View 9 Replies
Apr 9, 2010
I am trying to make some sound script for my website, but I need to stop the sound when portfolio's class will open.[URL]
View 7 Replies
Feb 10, 2011
make the sound play first and then stop it?
var music:Sound;
var trans:SoundTransform;
var channel:SoundChannel;
var musicOn:Boolean = true;
[code]...
View 0 Replies
Dec 14, 2009
When my avatar bug makes contact with another type of bug, he eats it. Both bugs are movie clips; when the avatar gets into the collision detect zone of the edible bug, it triggers a quick animation in the "edible" bug: he becomes a blur for one frame then disappears (as though eaten).
The problem is the sound effect - a quick "whoosh". It needs to play once then stop. What happens now is that it's triggered repeatedly - a problem if the avatar passes over the edible bug slowly. If the avatar later passes over the spot where the edible bug was, the sound is triggered multiple times again. So I need the sound to play only once, then stop. There will be several copies of the edible bug's movie clip that need to behave the same way, so once the sound stops playing it needs to be available again for the next collision.
Here's what it looks like now:
private var sfx_edible:Sound = new eat();
function detectCollision(myevent:Event):void {
if (avatar_mc.hitTestPoint(edible_a.x, edible_a.y, false)==true) {
[code]....
View 1 Replies
May 6, 2009
Pause and Resume external SWF sound filesI have this code that plays the sound through linkage. It reside in scene1.fla -> scene1.swf.
var mc:MovieClip = this.createEmptyMovieClip("mc",1);var myLoop:Sound = new Sound(mc);myLoop.attachSound("bg_sound");myLoopVolume=0;myLoop.setVolume(myLoopVolume);
mc.onEnterFrame = function () { if (fadeIn01==1) {
[code].....
View 1 Replies
Sep 3, 2010
I made a webiste with bg sound home, portfolio, gallery, contcts. This are the links. when click portfolio, which contain a flv file, when clicking the flv file bg music stop and video will play smoothly.But if i navigate to other links the sound from the flv remains their and my bg music not playing also.. one code SoundMixer.stopAll(); i got this code b4, it vil stop all sounds... i dnt need to stop the background music, i need to stop only my flv video sound.. there's a bg music playing, when entering to the portfolio section thers a flv video vth sound. i can stop all other sounds ven playing this flv video but i cant stop this sound ven navigating to other sections and i need to continue the bg sound ven navigating to other sections...
View 1 Replies
Jun 2, 2011
i am using soundmanager to order sounds. my site preview, in home page, square shapes comes into stage and you can drag drop them, all shapes binded its own sound. if they are colliding binded song will play.
the problem is i have 3 second timer to control sounds. every timeout i have to stop sound and play again for synchronous issue, that is my solution for that part. but sometimes before loop, there is an annoying little silence.
View 1 Replies
Aug 15, 2010
I have added some three sound clips, play pause buttons, on the root timeline in a movie with corresponding callouts. I am able to stop all sounds on the main timeline by below
stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
function stopSound(event:MouseEvent) {
SoundMixer.stopAll();
}
But now how do I resume all the sound to play. In sort, mute unmute root sounds in AS3.
View 1 Replies
Sep 19, 2011
Initially I want to control a movie clip (play, pause) using two buttons. I placed a movie clip(square) and two buttons (btnPlay, btnPause) on the stage.and created Engine.as assigned to stage.
/// Engine.as ///
package {
import flash.display.Stage;
import flash.display.MovieClip;[code]...
View 11 Replies
Feb 12, 2010
I used a tutorial ("Photo Gallery and Thumbnails: Flash Tutorial!" by tutvid on utube) to create a gallery on my website. I love the thumbnail navigation but, I want it to play like a slideshow when it first opens and I want to add play/pause buttons. I am using Flash MX 2004 and don't know much at all about actionscript or how to make these modifications. I emailed the author of the tutorial to see if it was possible to make these changes his reply was: "Yes, it is possible to modify the file in this way, however I don't remember how I set it up so I wouldn't be able to re-code it for you in this email. I would take a look around the web at Actionscript 2.0 slide shows and see if you can use the code they are using and make it work with your gallery."
View 4 Replies
May 21, 2004
Anyway, you see that the sound is on a seperate layer, with gotoandplay(1); or w/e on the end... so it indefinetely loops if left to it's own devices.
Now the actions for the play arrow button are:
[Code]....
Techincally, as to my VERY BASIC A/S knowledge, this should work right? I also tried instead of "on (release)" I tried "onClipEvent (mouseUp)"
View 8 Replies
May 21, 2004
you see that the sound is on a seperate layer, with gotoandplay(1); or w/e on the end... so it indefinetely loops if left to it's own devices.Now the actions for the play arrow button are:
on (release) {
play();
}
and the actions for the stop square button are:
on (release) {
stop();
}
Techincally, as to my VERY BASIC A/S knowledge, this should work right? I also tried instead of "on (release)" I tried "onClipEvent (mouseUp)"but that didn't work either?
View 8 Replies
Apr 26, 2009
i'm habing abit of problem with this code, its supposed to play pause and stop, the problem being that when i press stop then play it only plays from the last pause and not the beggining how to get it to play from the start after the stop button is pressed
[Code]...
View 1 Replies
Oct 6, 2010
the method for stopping/playing sound in 2.0 don't work for 3.0. i can stop the sound by going to a different page/frame on the site.but i want the buttons.
1. play button?
2.stop button?
3.mute button?
View 1 Replies
Aug 16, 2009
I created a movie clip that I am using as a button. I created the states in the clip (up, down, over) and the graphics work, but the sound is driving me crazy. I have a rollover loop that plays and a special click sound on the down/press. On the mouseclick, I want the rollover loop to stop and the down/click sound to play. Also, a getURL is happening on the release. Basically, everything works, except you can't hear the down/click sound. All sound just stops on the click.THis is AS2. Here's my code on the first frame. In the clip/button itself, I have the states labeled, the sounds placed using the properties and a stop on each keyframe of each state.:
playa.onRollOver = function() {
playa.gotoAndStop("_ovr");
}[code]/.....
View 1 Replies