ActionScript 2.0 :: Sound Toggle Using StopAllSounds()?

Apr 3, 2007

I have created a game where all the main actionscript takes place in one frame.For extra functionality I was going to add a button to toggle on/off sounds, after searching this forums and others Im left confused how to implement this.If i choose to use stopAllSounds() Im aware it only stops the current sounds and will not interfere with sounds about to occur.

Collision detection and random sounds occur within my game on an interval, is there a simple way to turn off all sounds permenantly? The only other id would be a button with a toggle and use multiple IF statements to check status of sound on/off.

View 1 Replies


Similar Posts:


Javascript :: SWF Video With Controls (toggle Sound On / Off And Toggle Play / Pause)

Jan 10, 2011

I'm new to flash and just need to do a simple task but I can't manage to get it to work. I'm trying to import a video (flv) into a SWF container and need to AS functions which should be exposed to JS (using liveconnect or anything else). These two function should toggle sound on/off and toggle play/pause. I dont need any user interface or a full featured player, just these two functions.

View 1 Replies

ActionScript 2.0 :: Resume Sound After After Apply StopAllSounds Function?

Nov 21, 2008

How can I resume sound after after i apply stopAllSounds function?

View 3 Replies

ActionScript 2.0 :: Sound Fade Out - Skip Intro Button - StopAllSounds();

Aug 7, 2006

I have an external SWF file and when I click on a "skip intro" button, right now I have a StopAllSounds(); on an onclick, so it stops the sound of the external swf, is there a way to fade out the sound instead on an onclick of an embeded sound on an external swf?

View 1 Replies

ActionScript 2.0 :: Toggle Sound On And Off?

Apr 28, 2008

I have a button, just one button, that I want to be able to use to toggle sound on and off. On the button I have included the following actionscript:

on (release) {
stopAllSounds();
}

Can I add additional script to turn it back on again? Maybe an if statement? The sound is currently being loaded and I cannot really add additional frames to make this work. I have to be able to include the script in one step if possible. Unless a movie with several buttons is the only way to go.

View 1 Replies

ActionScript 3.0 :: Get Sound Toggle (mute And On)?

Feb 20, 2009

I can get my mc button to mute it once, but never turn on again.The audio is a voice over in streaming in the main timeline.

Code:
var soundOn:Boolean = true;
onoff_btn.addEventListener(MouseEvent.CLICK,toggleSound);
onoff_btn.buttonMode = true;

[code]....

View 6 Replies

ActionScript 3.0 :: How To Toggle Sound Off/on Of A Music

May 31, 2011

The user should be able to toggle on or off the sounds button where clicking (on) will turn on the sounds while the button's label will be changed to 'off'Initially the sound is off.

View 4 Replies

ActionScript 2.0 :: Sound Toggle On Template File?

Jan 27, 2009

I have a Template file I am editing that plays music in the background. I want to shut it off when a Video is loaded so I added a stopAllSounds to the button. Works fine; however, I cannot figure out how to turn it back on again, as the template designer placed the sound file into a button rather than creating a sound Object. Was hoping someone could help me figure out how to restore sounds (I have tried adding Frame Labels to his sound movie/button but it returns me to the opening on the animation.

I have posted the file here if anyone would like to help. If no time for that, is there a simple way to output what is happening when I hit the toggle button, so I can copy that and try it?

View 1 Replies

ActionScript 3.0 :: Target/pause Mc From Sound Toggle Btn?

Nov 29, 2010

I have a movie clip on the main stage which loops an animation of a gramophone. On a separate mc in the layer above I have a working toggle button which plays and pauses a loaded mp3, but does not yet pause the MC animation beneath it. I need to find a way to target/pause/resume the gramophone MC insync with the sound button which is in another movieclip

View 0 Replies

ActionScript 3.0 :: Edit Code For Sound Toggle Button

Aug 19, 2010

I need it so the music plays at start and then the button will pause/stop it, and  then turn into a play graphic which, when pressed, will play it again. I tried editing the code, but I am horrible at programming and of course nothing I tried worked. Please let me know what I have to change to start with music playing, and then have it stop/pause on first press, and alternate "play" and "stop" on subsequent presses. 

[Code]...

View 9 Replies

ActionScript 3.0 :: Got A Toggle Button That Plays Sound When Clicked?

Jan 3, 2010

So I got a toggle button that plays sound when clicked, now I need it to stop playing sound when clicked again.

[Code]...

View 1 Replies

ActionScript 3.0 :: Edit Code For Sound Toggle Button?

Aug 19, 2010

this is the one code that I could make work, but I need it so the music plays at start and then the button will pause/stop it, and then turn into a play graphic which, when pressed, will play it again. I tried editing the code, but I am horrible at programming and of course nothing I tried worked. Please let me know what I have to change to start with music playing, and then have it stop/pause on first press, and alternate "play" and "stop" on subsequent presses.

[My fla has 2 layers, one for this AS, and one for the buttons... within the symbol section, I have two layers, one for the button common BG, and two frames in the button layer, one for play (triangle) and one for stop (square). They are saved as a movie clip.]

[Code]...

View 5 Replies

Actionscript 3 :: Flash Play/Pause Sound Toggle Button?

Sep 11, 2010

I've googled and googled but got no where or outdated tutorials. Anyone know how to make it so I can toggle audio with buttons using ActionScript 3 on Flash?

View 2 Replies

ActionScript 2.0 :: Mute Toggle Button To Specific Sound Clip

Jun 3, 2011

Creating the necessary code to make a mute/unmute button in ActionScript 2? I would like the "toggle" button to control a specific sound clip only -- not any other sound within my presentation. Basically I have an intro animation of about 20 seconds that has background music to it. I would like to add a mute toggle button that controls only this music clip and not any other sound found within my presentation. Is this possible? I've seen code for "globally" muting or stopping sounds. I need code for just a specific music clip (sound object?).

View 6 Replies

ActionScript 2.0 :: Sound Toggle Conflict With Music Fade In/out Scripts?

Sep 3, 2007

I have a video and background music in one flash file. I need the background music to fade out when the video is playing, and fade back in when the video is paused. Everything works fine until the Music On/Off button is inserted.If you try out the attached FLA, the background music is able to fade out when the video is played and fade in when the video is paused. But once you toggle the Music On/Off button, the background music fade in/fade out doesn't work anymore.

View 2 Replies

ActionScript 2.0 :: Toggle Any Settings When Importing A Sound Clip Into The Library?

Apr 28, 2008

I embeded an mp3 into a movie clip, and the source mp3 is professional quality, yet the embedded clip sounds horrible.

Is there a way to toggle any settings when importing a sound clip into the library?

View 2 Replies

ActionScript 3.0 :: How To Use StopAllSounds

Apr 4, 2010

I would like to keep the video sound from continuing after I go to the next frame in this file. Should I use "StopAllSounds" and if so where do i put it in the code?here is the code:

// Button ListenersnextBtn.addEventListener(MouseEvent.CLICK, nextSection);prevBtn.addEventListener(MouseEvent.CLICK, prevSection);
////////////////////////////////////////////////////////////////////// /////function

[code].....

View 8 Replies

IDE :: Use The Stopallsounds Command With An Exception?

May 28, 2008

Is there a way to use the stopallsounds command with an exception? I want to stop all narrations (in a presentation) when a button is clicked but keep the background music going. So i want to stopallsounds except the background sound.

View 9 Replies

ActionScript 2.0 :: Disable StopAllSounds Function?

Nov 23, 2009

i have a music player in my shell that plays background music. In swf files that are embeded (two layers in) I have videos playing.i want to make a button that stops the background music. Its too hard to communicate with the music player which is many layers away so i think i should use stopAllSounds.However, after i press it, it also disables the videos. how do i disable the stop sounds function, so that I can play videos, without turning the background music back on?

View 1 Replies

ActionScript 1/2 :: Restart Audio After StopAllSounds?

Jul 10, 2009

I have rather large project that contains several swfs flvs with audio. The project is published in Captivate (which renders a main swf file). After the preloader screen, a lot of the audio files start playing at once at the beginning of the presentation. I have tried inserting an swf with AS2.0 command "stopAllSounds". It works as intended and stops all the cacophony. But then, none of my audio plays throughout the 7 minute project. Does anyone know how I can restart the audio?

View 1 Replies

ActionScript 2.0 :: Using StopAllSounds(); To Stop All Background Sounds?

Mar 11, 2009

I am using stopAllSounds(); to stop all background sounds when i enter specific frame in my main movie and it works fine but how do i get sounds to continue to play when i exit this specific frame?

View 1 Replies

ActionScript 2.0 :: Transition Effect - AlphaTo Counterpart Of StopAllSounds

Aug 23, 2009

I'm building a dynamic gallery that supports SWFs for individual slides. In order to prevent background sound from carrying over from a previous slide to a different category page, I have attached stopAllSounds(); to navigation menu buttons. It does its job, but it turns off the sounds abruptly. I'm using alphaTo for transition effect from one page to another, and I'm wondering if there is a command that stops playing all sounds in gradation, so that I can make it consistent with page transition.

View 5 Replies

ActionScript 2.0 :: Dynamically Loading MP3s - StopAllSounds Function

Oct 13, 2002

Dynamically loading mp3's. I have 10 buttons, 1 stop and the others track 01 - 09, these are all in one .swf file. The buttons are all on one layer, on another I have defined all my sounds like so :

firstSound = new Sound();
firstSound.loadSound("track 01.mp3");
through to
ninthSound = new Sound();
ninthSound.loadSound("track 09.mp3");

Then I have the actions for my buttons
on (press) {
//Track 01 Button
stopAllSounds();
[Code] .....

I have uploaded the 9 mp3's, the swf & html file to same folder and this is what happens: [URL]. When any of the 9 track buttons are pressed 7 of the nine mp3's download all at the same time from pressing 1 single button (no track 3 or 9 which play fine normally and have definitely been uploaded) and none of the sounds work. But, when I refresh the page the 7 mp3's that were downloaded now work. The stop all sounds still work on buttons 3 & 9.

View 7 Replies

ActionScript 2.0 :: Opposite Action To "stopAllSounds"?

Jul 30, 2010

In have 10 scenes, each will having different audio files. Each scene will have buttons which take next and previous sc�ne. I am facing difficulties on controlling sounds.

I have placed action �stopAllSounds()� , because of this it will stop sounds in next scene also. I can�t call sound object as they are many.

View 1 Replies

Actionscript 3 :: Sound Latency - Set It For Any Silence Before The Actual Sound By Calling The Sound

Apr 16, 2011

I am triggering short sounds dynamically from the library for a game (Specifically Air for Android). When the user clicks a button the sound can take up to 600ms to actually play. I have set it for any silence before the actual sound by calling the sound like so:

[Code]...

All return the same results. I know there are threads here that talk about this but none have offered a real solution that I can find. Is there no way to cache the sound or store it in a buffer?

View 1 Replies

IDE :: Toggle Fullscreen In Flash?

Mar 15, 2010

note;ok considerinh flash swfs in flashplayer app all works fine so i think the problem is not inside swf but HTML when i run my index.html for the 1st time in browser(all of them i tried) it opens in normal mode. i hit toggle button and it switches me into a fullscreen mode. great success...well it aint)

sheme:
normal ----(1click) -- fullscrenn---(1click)--Normal

now when i go back from fullscr in to normal mode for the 2nd time, and want to hit toggle button to get again for the 2nd time to fullscren, i click the button and all that happends is my hand pointer turns to arrow pointer. And then i have to rollover and click button again to get to full scren mode..

sheme:
normal ----(1click) -- fullscrenn---(1click)--Normal ---(2clicks)--Fullscreen---(1click)--Normal

NOTE;from fullscreen to normal it always works ok(browser or flash palyer)but from 2nd normal to 2nd fullscreen i gotta click twice...something like once to activate a button again and then to click it for the action to execute..i dont know if i run this only in flash player localy toggle works perfect, and that is why i think the problem is in html parameters and not in swf...

View 4 Replies

ActionScript 3.0 :: Toggle Shape On/off?

Mar 22, 2010

I have a diagram with three buttons that when clicked, draws a line from that button to the corresponding movieclip on the stage. All this works fine but I'd like to build in a toggle button so I can turn each line off in any order. I'm having trouble understanding how to reference each shape that's been draw on the stage so I can remove it

Code:
var btnArray:Array = new Array(btn1, btn2, btn3);
var spotArray:Array = new Array(hotspot1, hotspot2, hotspot3);

[code].....

View 2 Replies

Actionscript 3.0 :: Buttons To Toggle Fields On/off?

Oct 8, 2009

I am trying to create an interface with multiple buttons (left side of screen) that will toggle on or off (increase alpha) multiple graphic fields (right side of screen) that are not mutually exclusive

Ex.

If btn1 is pressed (checked), fields a, b, c will turn on.
If btn1 is pressed (unchecked) again, fields a, b, c will turn off.
If btn2 is pressed (checked), fields b, c, d will turn on.
If btn2 is pressed again (unchecked), fields b, c, d will turn off.

[code]....

View 2 Replies

ActionScript 3.0 :: MC - Get A Button To Toggle Between To Functions?

Jun 18, 2009

I can't figure out how to get a button to toggle between to functions?It has to be more simple than an if()...else().. statement right?example:

myBtn_mc.addEventListener(MouseEvent.MOUSE_UP, what goes here?);

/* if the MOUSE_UP event is called and the chalkboard is blank, then write to the chalkboard
else erase the chalkboard */[code].......

View 3 Replies

ActionScript 2.0 :: Make A Button 'toggle'?

Dec 5, 2006

I'm simply creating a button in flash that should alternate between a 'play' graphic (i.e. > ) and a pause graphic (i.e. || ) every time its clicked. That's all!

In shockwave I would simply type a line of code that would set a new memberNumber or memberName to swap the graphics on mouseUp. How do I do it in Flash? I called a friend and he though I had to do something like create a movieClip inside a button or vice versa. It all seems rather complicated for such a simple task.

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved