ActionScript 2.0 :: Fading Sound When Button Pressed

Jul 27, 2005

I am looking for a way to play music when the movie loads, but when a button is pressed, the sound will fade to 0, then when the button is clicked again, it will fade to 100. Here is a link to the file I've been working on...

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Fading Out MovieClip When Button Pressed

Jul 2, 2004

on (release){
_root.drew._visible =false;
gotoAndPlay(31);
}
Above is my code which I am using to try and fade out a MC when a button is pressed. The button (and the picture it shows when pressed) are within the same MC. I have placed this MC on the root timeline and given the MC I want to fade out the instance name drew // but still not having any luck making invisible.

View 4 Replies

ActionScript 3.0 :: Make A Button Turn On/off A Sound When Pressed?

Jan 29, 2009

I am trying to make a button turn on/off a sound when pressed. I have tried to code it, but it does nothing everytime.

I have a sound in the library, with a linkage name of "sound" it is on the first frame in the main timeline. And i need a button to turn it off, and then on again.

View 0 Replies

ActionScript 2.0 :: Creating Volume Box That Appears When Sound Button Pressed?

Oct 27, 2003

Basically I am working on my personal portfolio and am not that good with AS. I have made a volume box that appears once the sound button is pressed. This box includes on and off buttons. The problem is how do I make the box stay, once the user clicks on a different button e.g. home? Its it simply a case of using keyframing or is it AS? and example of what I am trying to create is [URL]. Check the sound options.

View 1 Replies

ActionScript 2.0 :: Make A Box That Fades In When Pressed On The Button And Fade Out When Pressed For The Second Time?

Nov 16, 2004

I have a function on root:

_root.fadeBox_mc.onEnterFrame = function (){
if (fade){
this.nextFrame();[code]....

This causes a mc to fade in and out on rollover/rollout. But what I wanna make is a box that fades in when pressed on the button and fade out when pressed for the second time. But if I say

on (press){
_root.fade = true;
}

the mc fades in, but I cant do another on (press) to fade out. Is this too confusing?

View 2 Replies

ActionScript 3.0 :: Fading Sound In And Out

Sep 2, 2008

I am putting a flash website together. It is a picture of a group of people standing outside and at random intervals a storm will fade in and out giving dynamic rain/wind/thunder sounds and lightning. The only problem I have is fading the sound out. The sound fades in fine with the movie clip but when the movie clip disappears the sound continue.Here is the code for that part of the flash. The "randomness" of the storm is set to very high probability on purpose for debugging reasons.

View 1 Replies

ActionScript 3.0 :: Fading Sound With GTween?

Sep 9, 2009

I'm having an issue with fading sounds with GTween, can anyone let me know what I'm doing wrong here? Thanks in advance.

Code:

public function playBackgroundSound ( s : Sound ) : void
{
bgst = new SoundTransform( __volume );

[code]....

View 1 Replies

ActionScript 3.0 :: Fading Sound Doesn't Work

Jan 9, 2012

I have this problem when I try to fade in sound with the function below. It just doesn't work and I can't figure out where the problem is. I would like to fade in a looping sound but nothing happens.

this is used to play a sound via events

Code:
dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND, Main.SOUND_AMBIENT, false, true, false, 999999, 0, 0, setSoundVolume));

this is the function to play a sound. the stop-function is almost identical to this one.

Code:

public function playSound(soundName:String, isSoundTrack:Boolean = false, fadeIn:Boolean = false, fadeOut:Boolean = false,
loops:int = 1, offset:Number = 0, volume:Number = 1):void {

[Code].....

View 7 Replies

ActionScript 2.0 :: Fading Out A Sound Object After 2 Loops

Dec 10, 2006

I'm trying to figure out how I can fade out a sound object after it has looped twice. Right now the sound fades 5 seconds before the end of the first loop (since the fade code is based on the duration of the sound clip).Seems like there needs to be a way to count when the duration has been reached two times and then the fade code is executed. Note: the linkage identifier of the sound clip is "mainPageLoop".[code]...

View 1 Replies

ActionScript 3.0 :: Flash Fading Sound Does Not Work

Jan 9, 2012

When I try to fade in sound with the function below. It just doesn't work and I can't figure out where the problem is. I would like to fade in a looping sound but nothing happens. This is used to play a sound via events
Code:
dispatchEvent(new CustomEventSound(CustomEventSound.PLAY_SOUND, Main.SOUND_AMBIENT, false, true, false, 999999, 0, 0, setSoundVolume));

This is the function to play a sound. the stop-function is almost identical to this one.
Code:
public function playSound(soundName:String, isSoundTrack:Boolean = false, fadeIn:Boolean = false, fadeOut:Boolean = false,
loops:int = 1, offset:Number = 0, volume:Number = 1):void {
if (fadeIn) {
tempSoundTransform.volume = 0;
[Code] .....

View 5 Replies

ActionScript 2.0 :: Sound Fading In Function With Prototype And SetInterval

Aug 4, 2005

I'm trying to create a function that will help me fade in sounds with the help of setInterval. I'm almost there! Here is the code so far:

// Begin
melodyhalf1 = new Sound("melodyhalf1_mc");
melodyhalf1.attachSound("melodyhalf1");
melodyhalf1.start(0, 99);

[Code]....

I placed a comment in the Sound.prototype.fadeIn to test if it was being called, as well as to see if the melodyhalf1 variable (object?) was being passed.

The results are that the fadeIn function *is* being called, but the trace(this) comes back with 'undefined'.

View 4 Replies

ActionScript 1/2 :: Fading Background Music - Video Sound Also Turned Off

Sep 20, 2010

I have a flash file with a background music sound object, and I have a video player at a particular section on the timeline. When the playback head goes to the section with the video player, I would like the background music to fade, but of course, I need the volume to be up for the video. The code I have works find to fade the audio, but the problem is that the video's sound also turns off.

This is the code at the beginning of the timeline:
_global.volumeVar = 40; //Stores the current volume.
bgSound = new Sound(this); //This block works finebgSound.attachSound("music");bgSound.start(0,99);
bgSound.setVolume(0);
[Code] .....

Further down the time line, in the video player section, there this code, which works to fade the sound, but seems to turn off the video, too:
nInterval = setInterval(fadeOutSound, _global.volumeVar);

View 5 Replies

ActionScript 1/2 :: Play Sound When Key Is Pressed?

Oct 9, 2010

Alright so I'm creating a car game, I have a soundclip in my library called "engine"And I want it to play all the time except when I press the up button. When I press the up button I want my other sound "engine_2" to play when the key is pressed down and when released "engine" should start again.Both sounds should loop all the time when played.I'm a beginner with AS2 so be easy

View 3 Replies

ActionScript 1/2 :: Play Gun Sound While Key Is Pressed?

Nov 14, 2010

I want my uzi sound to play when space is pressed and I know how to do that, but
I want the sound to play for 2 frames then the same sound should play again and stop the first one so it starts from the beginning when space is pressed down. Otherwise they just overlap eachother and it will sound wierd.And when the key is released the sound that's already beginned should play to it's finnish

View 3 Replies

ActionScript 2.0 :: Play Sound When Key Is Pressed?

Oct 9, 2010

Alright so I'm creating a car game, I have a soundclip in my library called "engine"And I want it to play all the time except when I press the up button. When I press the up button I want my other sound "engine_2" to play when the key is pressed down and when released "engine" should start again.

View 2 Replies

30 Buttons With Sound But Only Plays The Pressed Ones In Sequence?

Jun 12, 2010

I�v build a simple flash projector to offer to my local fire department Essentially they used to in internal audio alarms to warn firefighters when there is an accident, fire, aggression, etcIn the version 1.0 they click several buttons, one to play the alarm sound, otherto announce the vehicle or vehicles that goes out, and a last one that says what is occurring.

The problem they report is that the sounds play immediately when you click in each of the buttons, and even the sound overlaps the other, which makes they click on each button and have to wait for the sound to finish and then click next. All this is normal because I associated the sounds to the buttons. What do I need to do the flash in this order in the version 2 of my projector:

1 The Fireman choose the type of alarm you want to play and click the button corresponding (but do not want the sound to play now) let's imagine that he pressed the button "alarm 1"

2 The Fireman choose (s) vehicles which are going out to the occurrence (but do not want the sound to play now) let's imagine that pressed the button "ABSC01"

3 The Fireman choose the type of occurrence (but do not want the sound to play now) we will imagine that pressed the button "fire"

4 finally the fireman holding down the "PLAY" (the green on on the top of the image) and this Makes the sounds selected to start playing in sequence, liker "Alarm 1" then "ABSC01 "and then" Fire "

Logically speaking I believe that each button must declare a variable associated with every unique sound, and then pressing the button takes the variables and plays them in sequence and without overlapping sounds.

View 1 Replies

ActionScript 2.0 :: Play Sound When Space Is Pressed Down?

Oct 10, 2010

I want my sound to start when I hold the space button and stop when I release it.It should loop all the time when space is pressed down.

View 1 Replies

ActionScript 2.0 :: Motion Tween The Button To Return Up To Its Original Spot When Another Button Is Then Pressed?

May 26, 2005

I'm trying to create a set of 4 vertically arranged buttons that 'split' apart when those buttons are pressed. For example, if you click the topmost (1st) button, the bottom three buttons will drop down so submenus (for the 1st button) can now be revealed beneath. Again, when you click the 2nd button from the top, the bottom two buttons drop down, revealing submenus, and so on.

Now, is there a way that I can use actionscripting to tween the buttons to not only motion tween a drop down when a button is first pressed, but also to motion tween the button to return up to its original spot when another button is then pressed? Right now, I have two keyframes, side-by-side which each containing a different y-scale value for an object. Can I do some actionscripting to get the object to motion tween upward to its original spot instead of "clicking," or snapping back to is original spot when another button is pressed?

View 1 Replies

ActionScript 2.0 :: Snap - Press Button To Detect The Last Button Pressed And If The Shapes Match

Jan 12, 2009

I want the press button to detect the last button pressed and if the shapes match, make them do something...obviously. I think I'm going at it the wrong way. I need to stick a "triange" id into the button/mc then if compares that and then if there is a match works then... right?

[Code]...

View 1 Replies

What Button Event Should Use To Make The Program Understands To DO SOMETHING Only When The Button Is Pressed / Dragged

Aug 4, 2009

What button event should I use to make the program understands to DO SOMETHING only when the button is pressed/dragged. In my sample code below, I want something to happens only if the button is dragged beyond 200 in y axis. I tried onRelease, onRollOver and onDragOver but still not working

[Code]....

View 6 Replies

ActionScript 2.0 :: FLASH 8 - Toggle Button/released State/pressed Button

May 18, 2007

I have a series of buttons inside an array. I am trying to get the buttons so that once they are pressed, they remain in the over state. Which is a darker color than the up state. So that people know which button they have pressed. Is there an easy way to do this for buttons?

View 1 Replies

Button Not Functioning Properly \ On The Homepage Is A Enter Site Button, Which Once It Is Pressed Starts Thetimeline?

May 15, 2009

I'm creating my first website. I've managed to create a homepage. On the homepage is a enter site button, which once it is pressed starts thetimeline... I have an actions/labels layer which I am writing my code in. On frame number 'one' is my code below.

stop ();
enter_site_btn.addEventListener (MouseEvent.CLICK, buttonClicked)
function buttonClicked (event:MouseEvent): void

[code].....

View 5 Replies

ActionScript 3.0 :: Make Button's Function Execute Once Without Button Being Pressed

Sep 26, 2009

I have a function that executes when a button is pressed:

btnRandomAll.addEventListener(MouseEvent.CLICK, clickHandlerBtnRandomAll);
function clickHandlerBtnRandomAll(e:Event)
{

...but, I need it to also execute once, upon the file loading.

View 7 Replies

Fading Music With A Button?

May 13, 2010

So I have a button (currently loading a movieclip) and on the main stage there is a piece of music playing constantly while the user looks around the available options on the flash.

What I want to know, is there a way to fade out the music when the button is clicked?

Im using ActionScript 2.0 also :-)

View 2 Replies

IDE :: Mp3 Fading Mute Button?

Aug 2, 2009

i have an mp3 that plays as background music to my website with a mute button that fades the music in or out. This works using the code below that i found on another site.My problem is i would like to have this music added to an external swf that i could load into my main site in order to decrease the main site file size. When i load swf however, the music doesnt play. the button appears (which is also in the external swf) so i know that the movie is loading but no sound plays.

some_sound = new Sound();
some_sound.attachSound("Kevin Spacey 16bit.mp3");
some_sound.start();

[code].....

View 1 Replies

ActionScript 3.0 :: Fading Out And Fading In 2 Flash Movie File

Mar 30, 2012

I'm trying to play 2 external flash movies. its already running ok but i need the scene to be somewhat to gradually become transparent so that the timebased scene2 will comeout to of the screen.

Here is the script of it:

var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("scene2.swf");
myLoader.load(url);
addChild(myLoader);

[Code]....

View 2 Replies

ActionScript 1/2 :: Fading In An MC Works, Fading Out Doesn't?

Apr 7, 2009

I can't work out why - but when I try to fade out some text (by calling fadeoutSecondText), the text fades out, and then immediately fades back in. Fading in and out struggle against each other, resulting in rapidly flashing text!

[Code]...

View 7 Replies

Professional :: Button Over Sound Plays Again Before Button Down Sound

Apr 15, 2010

I've assigned a sound to the button over frame and a different one to the button down frame. When i over over the button the button over sound plays. When I then click the button, the button over sound plays AND the the sound I put in the button down frame plays.

View 8 Replies

Button On Pressed Stage

Oct 13, 2010

I have 2buttons. Each have 3stages: up, over, down.I want to have 1st button to stay on its 'down state' when pressed and then you should see 2nd button 'up' stage(down stage of 1st button is the same as up stage in 2nd button).If someone hovered again you see 'over' stage of 2nd button,when will click, button move to 'up' stage of 1st button.

View 1 Replies

ActionScript 2.0 :: [f5]fading Grid Not Fading?

Oct 11, 2003

when i test the movie all i see is a large grey box (border color) with a medium white box (box color) in the bottom right.when i edit the border and lose the grey box but leave its line borders then i get the image with the white box in the bottom right. i've got an image: instance named 'image', a box: instance named 'box' and a border: instance named 'border' and pasted in the actionscript in

View 5 Replies







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