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


Similar Posts:


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 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

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 :: 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

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 1/2 :: Play Movie/frame When Key Is Pressed?

Oct 8, 2010

I have a car that is a movieclip with 2 frames looping in scene 1 and I want the car to switch to another movieclip when I press the space  button and go back to the oroginal car clip when space is released and if possible add a sound when space is pressed.

View 4 Replies

ActionScript 1/2 :: Make A Movieclip Play Only While A Key Is Pressed?

Mar 21, 2012

this is the code i am using, i get what flash is doing, after i release the key it starts to play the "walking" frames- only i include the gotoAndStop("idle") so it doesn't get to play "walking".but what i am looking for it to do is play the  walking only when the key is pressed and stop when released.

onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT))//68
{
this._x += moveSpeed;
this.legs.gotoAndPlay("walking");

[code]....

View 1 Replies

ActionScript 2.0 :: Play Movie/frame When Key Is Pressed?

Oct 8, 2010

I have a car that is a movieclip with 2 frames looping in scene 1 and I want the car to switch to another movieclip when I press the space button and go back to the oroginal car clip when space is released and if possible add a sound when space is pressed.

View 1 Replies

Actionscript 3.0 :: Automatic Fullscreen FLV When Play Is Pressed?

Feb 26, 2010

I'm developing a flash presentation which has a FLVPlayback component in the middle. I was wondering if it was possible to make the FLV clip automatically go fullscreen when the PLAY button is pressed, and of course play the video - once finished exiting fullscreen mode.

OR

If a fullscreen version of the FLV file is played when a graphic is clicked.

View 2 Replies

Actionscript 2.0 :: Play Button Continuous After Pressed?

May 4, 2011

I am learning Flash on CS3 and I have created a scrolling background image which works great. I found a simple play button that works fine using AS2, I use stop(); on frame 1 and on a separate layer and then on the same layer I have a drawn play button on frame 1 I use this

code

on(release) {
root.gotoAndPlay(2);
}

Works good but now the scrolling animation stops after frame 40. How can i get the animation to be continuous after I hit play?

View 2 Replies

ActionScript 2.0 :: Button Is Pressed - Mc Starts To Play?

Mar 19, 2006

when button is pressed one mc starts to play. when another button is pressed the first button related mc is smoothly played to the end... after that only second pressed button related mc starts to play...

View 6 Replies

ActionScript 3.0 :: Create Dynamic Sound To Play Sound-file?

Oct 14, 2009

It's possible to play a sound file through AS, either by loading it from a folder or import it to flash. It's also possible to play a dynamic tone with flash.media.Sound + writeFloat.

But... is it possible to play a sound file with flash.media.Sound + writeFloat in some way? I want to play a sound file without having to deal with any files except the .swf!

View 9 Replies

ActionScript 3.0 :: Make That Function Play When A Button Is Pressed?

Jan 4, 2009

I have a very basic question. I have a custom class called caurina. I've imported the class and it works great. What i did is use that as a function called slide().

What I would like to do is make that function play when a button is pressed. I can't seem to find out how to do this anywhere. I am using as3.

Summary: When btn is pressed go play function slide()

View 6 Replies

Professional :: Movie To Play Foward While One Button Keeps PRESSED?

May 12, 2011

Soo this is a simple problem, i have a 60 frames movie in a Layer, and another layer with 2 buttons.I want the movie to play foward while one button keeps PRESSED, and to play backward when we keep pressing the other button.i tryed this simple code but it didnt work out.on (press) {nextFrame();}
 
I used this code in the button that plays foward but it only moves 1 frame. I am realy new a this,

View 6 Replies

ActionScript 3.0 :: Play The Diagonal Keyframes When 2 Arrowkeys Are Being Pressed At Once?

Apr 7, 2011

i'm working with don't supply me with any symbol/symbols that mean "and" I know || is for "or", ! is "isn't", but if I want to say something like:

if (event.keyCode == Keyboard.LEFT || event.keyCode == Keyboard.DOWN)
{
}

except instead of ||, I'm looking for a symbol that means "and" I have 8 renders of a walk cycle in 8 different directions. (stored on 8 different movieclips within the main movieclip.) I want to try making an "if" statement that plays the diagonal animations when 2 arrowkeys are pressed at once.

View 4 Replies

ActionScript 2.0 :: Play Sound/stop Sound Button?

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

ActionScript 2.0 :: Create A Stopwatch That Starts At 00:00 When A Play Button Is Pressed?

Aug 6, 2009

I'd like to create a stopwatch that starts at 00:00 when a play button is pressed, and then stops whenever the stop button is pressed. After the stop button is pressed, I would like the time to be displayed on the next frame, and say something like "You pressed the stop button in x". I'm using flash CS3...so actionscript 2.

View 4 Replies

ActionScript 2.0 :: Creating A Stopwatch That Starts At 00:00 When A Play Button Is Pressed?

May 2, 2010

I'd like to create a stopwatch that starts at 00:00 when a play button is pressed, and then stops whenever the stop button is pressed. After the stop button is pressed, I would like the time to be displayed on the next frame, and say something like "You pressed the stop button in x".

View 1 Replies

ActionScript 2.0 :: Making A Movie Clip Play ONLY When A Button Is Pressed?

Jan 17, 2011

I have a button, labeled "Main1," in a scene, "Main." When I click said button, I want an animation to start. Said animation is a movie clip named "ArrowAnim."Now, I have done something similar before in another project, using a code which I thought would have worked with this movie clip as well. The code I used before (and which worked flawlessly) was:

Code:
on(release)
{

[code]......

View 4 Replies

ActionScript 1/2 :: Make Audio Play And Pause / Stop When Different Buttons Pressed?

Jun 12, 2010

I am making a simple radio interface and i have 6 preset buttons which i want to have play the specific preset button's song which is in the library and stop/pause the current song when any preset button is pressed.

i tried using the attachSound function, with associated identifiers but not sure if that is the right way to go. It plays the songs, but doesnt stop them.[code]...

View 12 Replies

ActionScript 3.0 :: Play A Certain Part Of MovieClips Timeline Depending On The Button Pressed

Nov 22, 2010

Right I only want to play a certain part of my MovieClips Timeline depending on the button pressed.

ActionScript Code:
stop();
CircleLineMC.KingsCross.addEventListener(MouseEvent.MOUSE_DOWN, KingsCrossBtn);
function KingsCrossBtn(event:MouseEvent):void {
BigSquare_MC.gotoAndPlay(1);
}

But I want it to play only up to frame 50 and then stop there and then loop instead of playing the whole timeline, does anyone know How to do that.

View 6 Replies

IDE :: Add Sound - Sound To Play On The 'Over' State

Mar 6, 2009

I'm trying to add sound to some buttons. It's just a little metallic 'klink' sound that plays on rollover. I only want the sound to play on the 'Over' state. So I've set up a layer (just for sound) for the button and I add my sound in the 2nd frame (the Over state). Everything is cool. All is good. And the sound plays on rollover. But the sound also plays when I click the button (i.e. it also plays on the "Down" state). Why? The Down state keyframe is completely empty. What's going on here? I've only put the sound in the "Over" keyframe, why does it also play in the "Down" frame (or when I click)?

View 1 Replies

ActionScript 2.0 :: Play Sound Like "stop All Sound" Option In Flash?

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

ActionScript 3.0 :: Play A Sound File And Show The Progress Of The Sound File Being Played

Mar 16, 2009

I have to play a sound file and show the progress of the sound file being played. I am using import flash.media.Sound; import flash.media.SoundChannel; But the PROGRESS event gives theprogress of loading of file. I want to know of much of the song has been played and how much more is left.

View 3 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 2.0 :: Swapping - Play The Client Side Mp3 First Then Only Play Server Side Sound Object Alternately

Aug 9, 2004

I am new to actionscript. I have created a script that will play server side sound object and client side mp3 files alternately. Now, I would like to play the client side mp3 first then only play server side sound object alternately. However, I have no idea how can I do so. The following is the code that need to be swapped:

[Code].....

View 2 Replies

ActionScript 1/2 :: Keys Pressed Or Not Pressed?

Dec 6, 2010

I am struggling a bit with keys on the keyboards controlling a movieclip to happen.Ive got a person moving when pressing right and left, and a movieclip with three frames: First frame is a movieclip with the person standing still, looking bored. The second frame is the person moving right, and the third frame is the person moving left.This is the code that Ive inserted into the persons actions on scene1:

if (Key.isDown(Key.RIGHT)) {_x += speed;this.gotoAndStop(2);_xscale = +scale;} 
if (Key.isDown(Key.LEFT)) {_x -= speed;this.gotoAndStop(3);_xscale = -scale;}
 
this code works alright accept that when the keys are not pressed it doesnt stand still, the legs are still moving, so I tried to include this code aswell:

if (!Key.isDown(KEY.RIGHT)) [code]....this makes the person standing still when not pressed but not moving the legs when turning right and left.

View 3 Replies







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