How to make a movieclip to play as long as you press a key?

This is the code that I use, I did what flash, after I released the button, it starts to play the 'walking' frames - I include only the gotoAndStop ("idle") so it's not the chance to play 'works '.

But what I want to do is play the market only when the button is pressed and stop when you release.

onClipEvent (enterFrame) {}

If (Key.isDown (Key.RIGHT)) //68

{

This moveSpeed ._x +=;

this.legs.gotoAndPlay ("walking");

This ._xscale = 100;

}

Else if (Key.isDown (Key.LEFT)) //65

{

This ._x moveSpeed-=;

this.legs.gotoAndPlay ("walking");

This ._xscale = - 100;

}

on the other

{

this.legs.gotoAndStop ("idle");

}

}

It should work... When let you go of left or right, he should go to the movieclip.legs slowed down frame

The only slightly odd thing is:

this.legs.gotoAndPlay ("walking");

because he goes to which frame, as long as the button is pressed, so that it remains on the frame of Tournay and it does not play, you could stop and do a new mc within this framework of market animation of legs.

Tags: Adobe Animate

Similar Questions

  • How to make a button to perform an action when you press return?

    I have a login button that I want to perform an action when you press return on the keyboard and I'm hoping to find someone in this forum can help me.

    To select the default activity you select the item , go to properties-> municipality you will find DefaultCommand. Here, you specify the ID of the control (button in your case) unit, which will be executed when you press on enter.

    Timo

  • CD, how to make the CD to play? It's a CD with instructions on how to install my printer.

    How to make a CD to play?  It's a CD with instructions on how to install my printer

    Insert the CD in your optical drive (if you have a DVD or CD drive)

    The CD should auto run and invites you to play or open the disk.

    If it isn't, try the following:

    Click Start > computer > open disk > and double click on the installation file or the MSI installer.

    The disc should come with instructions on how to use it.

  • How is my laptop is not playing xbox games do you mean my phone is brocken?

    original title: Please quick xbox geek 123 ansewer

    How is my laptop is not playing xbox games do you mean my phone is brocken

    How is my laptop is not playing xbox games do you mean my phone is brocken

    No, your laptop is fine. Xbox games can not be played on a PC (you can use the controllers to xbox for some PC games however).

  • How to make a very short page any longer the footer appears so under screen

    I am new to Dreamweaver and having a problem to find how to make a page (contact) very short longer so that the footer appears below the screen.  Currently the footer shows Mid-screen because the page is so short.  Thank you!

    Since you haven't posted any code, I guess that you have a CSS rule in your style sheet main governing the footer.

    You cannot add a margin-top to this rule because it would affect the footers on ALL your pages.

    I suggested a styleblock only on the contact page which would negate the main style sheet on the contact page

    This would be thesection of the contact page.

  • When you press a key, it causes a change in working capital in the theme color. How do undo you this?

    ORIGINAL TITLE: Keyboard is disabled for a specific user only.

    When you press a key, it causes a change in working capital in the theme color.  This was done deliberately.  How do undo you this?  It is a roaming user on our network profile.

    Hi Koosharem219,

    If you still experience the issue, pressing any key changes the color of the theme, please create a new thread in the Windows XP IT Pro forum. The experts in this forum are better able to help you configure this user account.

  • How can I make windows play a sound when you press the SHIFT key

    My keyboard doesn't have a light to indicate when it is capitalized. He used to play a sound, but it is more the fact after that I said not to do. However, when entering passwords that are case sensitive, it gives the wrong password. Can someone tell me how to re - turn on the sound.
    Its a Logitech MK320 wireless

    Look in Control Panel > accessibility, and then click "make the keyboard easier to use." Check the box "turn ToggleKeys. This will produce a note when you press the lock keys. Or just check the other box beneath it. In this way, you can turn the tone on or off without having to return to these settings.

    SC Tom

  • How to make a movieclip and import it into another fla file?

    Hello

    I'm having one of those moments of "self doubt mental health."

    Entering the melting below!

    I want to do a clip from a background of graphics card and some existing movieClips that reside in another .fla

    In this other .fla file clips are in the wrong layer in order to start over, I would like to put things away.

    How can I create a clip like this?

    Then I started thinking, how can we create a clip, and then get into another file?

    I even did a test that went: -.

    (1) create the new AS3 file

    (2) draw a box of

    (3) box and press F8 convertir convert to symbol, select movieclip and name it box_movieclip

    (4) box of d/click and consist of a classic Tween and box moving across the stage.

    (5) save under and the file named MovieClip_Boxtest.fla

    (6) open new AS3 file and import into the library of the BoxTween.fla and had a message saying one or several files not imported as their reading problems.

    So after doing the above steps 1 to 5 makes a movieclip, how to do that in another fla file?

    having done this before that I'm panicking that I lost some brain cells!

    Envirographics.

    When I want to move a movieclip of one fla to another I just right click in the library and select copy.  Then, I go to the library of the FLA, library (off the coast of any other symbol) right click and select Paste.

  • How to make a scene to play backward

    How can I make a certain scene play back? Just a scene... I want ot have it play normally and then on a copy of it to play back...

    I don't really know how scenes work... but you can reverse the images by selecting the images you want in the layer of chronology... right click and select reverse images.

  • How to make my movieclip link button to a URL?

    I have a movieclip and actionscript on a separate layer that controls the clip. However, I would like to be able to make a link to a URL when I click on the button. Based on what I have anyone know how teck my code? Allows to pretend is the site I want to make a link to "http://www.google.com/ig?hl=en'. '"

    Here is the code:

    ProductMarketingIcon_mc.onRollOver = function() {}

    ProductMarketingIcon_mc.gotoAndPlay ("normal");

    }

    ProductMarketingIcon_mc.onRollOut = function() {}

    ProductMarketingIcon_mc.gotoAndStop ("normal");

    }

    ProductMarketingIcon_mc.onPress = function() {}

    ProductMarketingIcon_mc.gotoAndPlay ("over");

    }

    Thanks for your help!

    It's as2:

    ProductMarketingIcon_mc.onRollOver = function() {}

    ProductMarketingIcon_mc.gotoAndPlay ("normal");

    }

    ProductMarketingIcon_mc.onRollOut = function() {}

    ProductMarketingIcon_mc.gotoAndStop ("normal");

    }

    ProductMarketingIcon_mc.onPress = function() {}

    getURL ("http://www.google.com/ig?hl=en");

    ProductMarketingIcon_mc.gotoAndPlay ("over");

    }

  • How to make photos of time play in a movie

    I figured out how to use the eos utility to make photos of time but how do I sting the pictures together to look at the time photos

    Tony1,

    This is possible by using our latest ImageBrowser EX software.  If you have not already installed, you can download it here.

    In ImageBrowser EX, select each image, then click on Edit and select Edit movies.  The MovieEdit work window will appear, guide you through the process.  You can add images, arrange them, add transitions and audio as well.

    This has not answered your question? Find more help contact us.

  • I burned a bunch of digital files on a cd - r, they will play on my computer, how to make the cd to play on my dvd recorder or other players?

    I did a video cd which is the type cd - r format. He will play on windows media player, but my recorder sony dvd won't play it. It is said: unknown disc, please check again. What should I on the disk or the files to play on other players?

    Depending on the software you used to burn the CD, you might have to "finalize" or close the CD.  The option often says "make this disc can be read by other computers" or something similar.

  • How to make a video file play webm?

    I have one to appear by placing

    video var = $("< vidéo/>");

    SYM.$("vContainer"). Append (Video);

    Video.Attr ('id', 'video1');

    WEBM var = $("< source/>");

    Video.Append (WebM);

    WebM.attr ('src', 'big_buck_bunny.webm');

    WebM.attr ('type', "Video/WebM");

    on compositionReady, where vcontainer is a div on the stage. I can see the first image.

    I also added a div to act as a 'play' button. On his Manager click I added

    SYM.$("VIDEO1"). Play();

    but it does nothing. How can I control the video?

    The last edge animate CC 2014 now supports native HTML5 video. You can try the functionality.

    Find more information @ https://helpx.adobe.com/edge-animate/using/whats-new.html#Support%20for%20native%20HTML5%2 0video

    DIA-

  • How to make a motion tween play when you click it?

    I am brand new to the FLASh and I have a motion tween of a wheel that rotates 360 degrees and I need to play when it is clicked on.  This is probably something that is really easy to do, but I just can't understand it.  Someone at - it good indications?

    Hello

    you need to do an instance name for your movieclip, for example "myMC". Select the first frame in the new layer, and then click window-> Actions.

    To write:

    myMC.stop (); stop your mc when movie starts

    myMC.addEventListener (MouseEvent.CLICK, regarderMovie); Add a listener for the click of the mouse the mc that will trigger the function playMovie

    playMovie(event:MouseEvent) //function MC function start

    {

    myMC.play ();

    }

    I hope this has been helpful.

  • How to make a movieclip wait before he does something

    OK, im doing an animation explosion for my pong game but I want the ball to explode before it moves again in the Middle, but now it explodes whilest in the Middle

    Ahh and I discovered it already, if you place the scripts in the (last) image of movieclip (explosion) instead of on the movieclip it will explode before it will return to the Middle

Maybe you are looking for