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


Similar Posts:


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

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 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 :: Can't Make A Movieclip Play?

Dec 14, 2007

I'm really gettin wound up now by this. I have made the navigation for my site, and here's some sample code for making the button animation work;

Code:
on(rollOver) {
if (!(_global.about_a == 1)) {

[code].......

View 5 Replies

Make A Frame Become Visible And Play / When Click On A Movieclip

Apr 27, 2009

This time I'm experimenting with visibility. All the tutorials online vary a lot. I'm trying to find something noob proof. I have actionscript 2 and 3. I'm not sure which one to use..I'm just trying to learn how to make a frame become visible and Play when I click on a movieclip.

View 5 Replies

ActionScript 3.0 :: How To Make Nested MovieClip Play Once Then Stop

Nov 4, 2010

I have a nested movie clip (image sequence) that I use the code snippet from Flash CS5 to GoToAndPlay. The Movie Clip loops continuously. How do I get it to play once and stop. I've tried the snippet for GoToAndStop, I've tried stop(); in my 'Actions' layer. I've tried a stop(); in the last frame of my nested sequence. I've tried a stop at the end of the function but nothing stops the darn thing. It keeps going and going and going.

Here is my typical code that loops....
stop();
btn3.addEventListener(MouseEvent.CLICK, cd_ClickToGoToAndPlayFromFrame);
function cd_ClickToGoToAndPlayFromFrame(event:MouseEvent):void {
gotoAndPlay(1); }
btn4.addEventListener(MouseEvent.CLICK, ef_ClickToGoToAndPlayFromFrame);
function ef_ClickToGoToAndPlayFromFrame(event:MouseEvent):void {
gotoAndPlay(10); }

There are two(2) buttons on the page, basically and back and forward button, and the image sequence is nested in a movie clip in this case at frame (1) and another nested movieclip at frame (10). How can I make it play once and stop on the last frame of the nested clip?

View 3 Replies

ActionScript 2.0 :: How To Make MovieClip Play With TellTarget Command

Oct 7, 2003

I have a movieclip in the mainframe that on a button release gets moved to the center of the screen with some set_property stuff and then I want the clip to play. So I added a tell_target on release, the target is /movieclipname and I then Go_To_and_Play the first frame. I have a stop action as the first frame of the movieclip as to keep it from running when I dont want it. I want that tell_target to make the movieclip play but sofar no luck.

View 5 Replies

ActionScript 3.0 :: Make A Movieclip Display And Play When Click On A Button?

Jul 23, 2009

I'm looking to have a movie clip pop up, play itself after a user clicks on a flash navigation button.
 
(something like this???)  
message_btn.addEventListener(MouseEvent.CLICK, goMessage1);
function goMessage1(evt:MouseEvent):void{    ???(play message movie clip here)???;}

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

ActionScript 2.0 :: Call An OnClipEvent(enterframe) Of A Movieclip To Happen When That Movieclip Is Pressed?

Oct 24, 2007

how do you call an onClipEvent(enterframe) of a movieclip to happen when that movieclip is pressed?

[Code]...

when i type this in i get an error because on events cannot be nested within other on events. how can you get around this?

View 10 Replies

ActionScript 2.0 :: MC - Click On Movieclip And Make It Go To And Play A Keyframe On The Main Timeline?

Jul 28, 2010

I have a movieclip (a), inside another movieclip (b), on the main timeline. I want to click on movieclip (a) and make it go to and play a keyframe on the main timeline. I'm used to using buttons for actions, not movie clips, and I forget how to use the _root thingy.

View 3 Replies

ActionScript 1/2 :: Make Flash Play Movieclip For Rollout Effect On Button

Oct 21, 2010

I have a movieclip within the "over" section of my button, which contains both an roll over and a roll out animation. My problem is that I cant seem to get flash to play the rollOut animation.
 
I placed the following code in the button itself

on (rollOut) {  this.start_mc.gotoAndPlay("mouseOut");}
 
I tried setting up a function to find when the user rolls off the button but it didn't work either.

View 1 Replies

ActionScript 3.0 :: Make Buttons Within A Movieclip Play From A Specific Frame In Scene 1?

Aug 30, 2011

I have a movie clip on the main timeline. This movieclip has buttons that I want to play different frames in scene 1.
 
At the moment, this is the code I'm using in scene 1.
 
[Code]...
 
I'm getting the error below but have no idea what I should be doing.
 
[Code]...

View 3 Replies

ActionScript 3.0 :: Make Button Instance Containing Movieclip Play Specific Frame?

Sep 27, 2011

What I want to do is have one movieclip that has many frames and turn that into a button and then make different instances of the button and have those instances display a certain frame of the underlying movieclip.

View 17 Replies

ActionScript 2.0 :: Make A Button Do Two Things / Play A Movieclip And Goto Frame

Aug 27, 2005

What im trying to do is play a movie clip between frames. So say we have two menus, when you are on menu 1 and you click the button for menu 2, a short movie clip plays and then you stop on menu 2. I realise I can do this by putting the movie clip on the main scene timeline, but is there anyway i can put it on the button? I think the action script would be something along the lines of "On release play MovieClip and goto frame X" As i said i want the movie to play as an almost filmic transition between menus, with a fade up and then out (Have got that bit sussed using the alpha controls)

View 3 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 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 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 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 2.0 :: Detect The Pressed Movieclip Outof 4 Movieclip?

Jun 13, 2011

i am new to flash AS,i have 4 movieclips, those have the 4 option of a question, when i select the answer,if it correct means my score will increase otherwise it will show alert,for that first i have to press the any one movieclip out of 4 options, in AS3.0 addEventHandler will work for AS2.0 what will i use to achive this

[Code]...

in this answer1, answer2,answer3,answer4 are the movieclip for 4 options

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







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