MovieClip stop when the animation is over

I do a style RPG game and I have a MovieClip Mike, who has, on each of the four images, different MovieClip that contains a different animation. Frame 1 is standing, frame 2 is running, frame 3 stops and frame 4 is an animation of punch.

I controlled him in a .fla test like this:

stage.addEventListener (MouseEvent.CLICK, runAndPunch);

var mike: MovieClip = mike

function runAndPunch(evt:MouseEvent):void {mike.addEventListener (Event.ENTER_FRAME, moveMike);

}

function moveMike(evt:Event):void {}

mike.gotoAndStop (2);

Mike.x += 10

If (mike.x < = 275) {}

}

else {}

mike.removeEventListener (Event.ENTER_FRAME, moveMike);

mike.gotoAndStop (3);

mike.gotoAndStop (4);

mike.gotoAndStop (1);

}

}

This triggers every time that the mouse is clicked and Mike (mike instance) run in the middle of the screen, stop, punch and return to his idle animation. But because each picture Mike is a movieclip in itself, this code end running before you can even see the animation to stop.

How would I go about triggering of these animations in the right timing?

I can't determine what you see, but I can tell you that your code will do exactly as I explained in the message 2.  That is to say, you won't see framework for 3rd or 4th Mike.

Tags: Adobe Animate

Similar Questions

  • Satellite Pro L500 - stops when the power cord removed

    Toshiba Satellite Pro L500 stops when the power cord is removed even with the battery to 100%. I removed the battery and all the indications associated with battery answer correctly. For example turns off, Toshiba Health Monitor also indicates when the battery is removed. If installed Health monitor indicates that the battery is at 100%.

    Someone please help. I have not installed anything new.

    Hey,.

    For me, the matter is clear: the battery can't hold a charge so the laptop will be shut down because it has no power.

    I think you need to replace the battery with a new one and you can get a provider of service authorized in your country. Simply contact the guy and ask that they can tell you how much it would cost.

    You can find a list of all FSA here:
    http://EU.computers.Toshiba-Europe.com > support & downloads > find an authorized service provider

    Good luck! :)

  • Satellite Pro L10: CMOS clock stops when the OS is not running

    Hello

    We know a reason why the cmos clock would stop when the operating system does not (phone off), the laptop is 18 months old, I've updated the bios tries to give him a good boost, but no effect, he was also in charge for 24 hours.
    Any advice would be great.

    See you soon
    Paul

    Hello

    Usually if the BIOS date/time is wrong and always changes, the RTC battery which is mounted on the motherboard fails.
    In this case the CMOS battery needs to be changed or maybe only removed for awhile

    If your laptop is 18 months, the guarantee must be valid.
    Generally if you have registered on the page of Toshiba notebook the warranty covers all repairs for about 2 years (24 months).

    In this case, I would recommend contacting ASP in your country, because the technician must be able to solve this problem very easily.

    Good bye

  • MacBook Pro stops when the lid closes, loses the open tabs and background image...

    Hi all

    I recently had a new hard drive installed in my 2012 13-inch MacBook Pro. I am running El Capitan 10.11.2. Since then, my computer cuts automatically to the bottom when the lid is closed, losing all Web pages, and for some reason, some background, I've saved. (My browser is Mozilla Firefox and it prompts you to restore me the tabs lost, which he will).

    The led standby does not blink or light up when the computer is turned on, it will turn on only at startup. At startup, the login page is displayed, and after that I entered my password it takes about 15 to 25 seconds to load and open my account. What is going on?!

    Summary:

    Stop when the lid is closed,

    Loses the background image & open Web pages.

    Standby blinks only when starting,

    Time of loading extended after logging into my account.

    Any help would be greatly appreciated! Thanks a lot for reading.

    uhlexia wrote:

    Hi all

    I recently had a new hard drive installed in my 2012 13-inch MacBook Pro. I am running El Capitan 10.11.2. Since then, my computer turns off automatically when the lid is closed.

    Take it back to the repair as well as your receipt of repair shop.  Apple has a 90 day warranty on all repairs.

  • New Yoga 14 stops when the lid closes

    I just got a new series of Yoga 14. Sometimes, but not always, the laptop stops when I close the lid, even when it is plugged. I already looked at the option to 'choose what happens when the lid is closed' and it is set to sleep, no downtime.

    Any ideas on how to solve this problem.

    Hi Nickajeglin,

    Welcome to the Forums

    According to the request, we understand that you are facing problem with the system stops when the lid is closed in your Lenovo 14 yoga.

    As you mentioned that you have changed the setting to sleep, try changing to do nothing option and check also the question, if still the issue persists then uninstall and reinstall the power management and check the issue.

    Click here to for 10 windows power management.

    Let us know the result.

    Best regards

    Ashwin.S

  • While the loop does not stop when the two values are equal using equal to comparitor

    Hello world

    I have a really, really strange bug. I have a LabVIEW VI that change a chain on a power supply. I have a start and a stop voltage and use a while loop to increment the device. For example if I want to scan from 1, 2V to 2.2 V in 0.2 V incremements, the program will end when "The current tension" = "stop the tension." And it works very well!

    However, when I start - 3 V and want to stop to say-0.8 (new in 0.2 V incremements) the program does not stop when "The current tension" = "stop the tension." I checked with the probe close to what should be the end of the race and - 0.8 V goes both of the entries ' equal to ' comaprison operator, but that his can't trigger a real result.

    It's very strange for me. Espeically as if I'm going - 0.8 V to-2 V but decrement of-0.2 V, the program stops correctly!

    I am very confused!

    See you soon!

    Search on: comparison of floating-point numbers

    The second thread is particularly relevant. This discussion was 2009, but you can find that the same "bug" being reported to enter the end of the 1980s.

    Mike...

  • Explorer.exe stops when the computer is shut down

    Explorer.exe stops when the computer is shut down

    Hi DickKimberley,

    ·         What exactly happens when you try to shut down the computer?

    ·         You receive an error message error code?

    ·         Did you do changes on the computer before the show?

    Follow the suggestions below for a possible solution:

    Method 1: I suggest you to consult the article in the Microsoft Knowledge Base and check.

    Advanced Troubleshooting for shutdown problems in Windows XP

    http://support.Microsoft.com/kb/308029

     

    Method 2: If the method above doesn't follow the article mentioned below.

     

    Windows stops responding during Windows XP shut down

    http://support.Microsoft.com/kb/307274

    Let us know if that helps.

  • computer Vista laptop does not stop when the lid is closed

    I have all the correct power settings. mode when the lid is closed, I tried setting Hibernate and sleep. It just keeps running and running, I'm afraid it will overheat. but it should stop when the lid is closed, correct? Thank you sissy

    Hello banditpunpun2,

    Thanks for the return of the response.  I also go to your manufactures website and confirm you are updated with the lates drivers, updates the firmware and BIOS.  I even watch the forums on the manufacturer's Web site to see if others have experinced the same question.

    Please let us know status.

  • Dell inspiron w / xp sp3 stops when the lid closed only in mode standby

    Dell inspiron e1505 on windows xp sp3 will stop when the lid closed mode standby. In "idle mode" it shuts down for a few seconds then screen turns on and I can work as usual.  Why is it turn off in standby mode?  Happens in AC mode and battery.  is it a software problem or a hardware problem.  I see others with the same problem and vista dell.

    http://support.Dell.com/

    Dell support.

    http://support.Dell.com/support/topics/global.aspx/support/DellCare/contact_us?c=us&l=en&s=Gen&redirect=1

    Contact Dell

    http://en.community.Dell.com/forums/

    Dell forums

    XP forums:

    http://social.answers.Microsoft.com/forums/en-us/category/WindowsXP

    Link above is for XP Forums.

    There is a list of the different Forums XP to the link above to help you.

    You get the help you need there.

    Here is the Vista Forums.

    See you soon

    Mick Murphy - Microsoft partner

  • BlackBerry BB Z10 Z10 stops when the battery indicator shows about 35%

    Z10 BB stops when the battery indicator shows about 35 percent without any warning. Does not illuminate until the charger is plugged. Immediately shows charge remaining 40% +.

    Please advice.

    Stephen

    Hello

    Here is a solution I tried after lookng through various forums and type of works for me. A common thing in most of the solutions is to take the battery and sim card out, leave like this for 1-2 hours and put them, I found back in and turn it on. I'm not sure of the logic behind it, but I remember reading that this overshadow the phone battery problems (connected incorrectly - essentially a reset) and begins to charge.

    I tried it 2 days back and I see that it worked for me, at least until now. I cross my fingers.

    I hope it's useful, works at least for few of you.

    Thank you all for the suggestions.

  • Will be that the download stops when the computer goes into sleep mode?

    Will download, install, or all these action stops when the laptop goes to sleep.

    MK

    Yes, it will be.

  • My computer is no longer warn me entry stop when the battery reaches the critical level.

    My computer is no longer warn me entry stop when the battery reaches the critical level. Officially, it shows a warning sign and told me to shot or recharge the battery when it gets to level criticism, but now he can't, but stop just when the battery has reached its critical level. No warning sign more.
    What should I do to get the warning before the pc turns off when the battery is at its critical level.
    My pc is hp laptop mini 110-3100. Start Windows 7.

    Hi Sage180,

    ·         Did you change in the computer before the show?

    Follow these methods.

    Method 1: Run the Troubleshooter of power.

    Method 2: Follow the steps in the article.

    Solutions to common battery problems

    Battery meter: frequently asked questions

    For reference: take care of your laptop battery

  • Printing of the .pdf of the 2013 project file will stop when the name of the file must be written. Project 2013 crashes. Anyone know what the problem is between 2013 project and Adobe Acrobat 9?

    Printing of the .pdf of the 2013 project file will stop when the name of the file must be written. Project 2013 crashes. Anyone know what the problem is between 2013 project and Adobe Acrobat 9?

    The family of products Acrobat 9.x passed in mid-2013 "end of Support".
    Using Acrobat 9 of MS Project via PDFMaker stops with Office 2007.
    To 2013 Office support, you must use Acrobat XI (11.0.1) or newer.

    A good reference:
    https://helpx.Adobe.com/Acrobat/KB/compatible-Web-browsers-PDFMaker-applications.html

    Acrobat Pro and Standard DC are what are currently available for purchase.

    Be well...

  • How to make a text box appear in a PDF file in InDesign CC when the cursor rolls over another area of text?

    I'm doing a text box appears in a PDF document in InDesign when the cursor of the user hovers over an another textbox, and I want it to disappear when the cursor moves off the coast of the first text box. I tried the following with adjustment of various, and it does everything just for me.

    Display a different button on turnover

    You can create a hotspot in which clicking or mousing over an object contains another object. To do this, create two buttons, hide one of the buttons and use the show/hide button action to show and hide the button target.

    • Create an object to use as the "source" button. In the buttons Panel, click the icon of the object to convert to A button.

    • Place the image you want to use as the button target and convert it to a button.

    • Select the target image and select hidden until this that triggered at the bottom of the Panel buttons.

      The image must be hidden in the exported document that can be displayed when the "source" button is clicked or wriggle on.

    • Click the source button and create two different actions, one for show the image target and target the other to hide the image.

      If you want the image to appear when the mouse is over the button source, use events on Roll Over and On Roll Off. If you want the image to appear when you click on the source button and disappear when you release, use events on a click and release. In both cases, use the show/hide action buttons to show or hide the target button. See the interactive buttons.

    • Use the Preview Panel to test the buttons.

    Should work...  On your last point (not 12?) I get the feeling that you have exported your doc as Adobe PDF (Print)? You must instead use (Interactive) Adobe PDF...

  • I want a music video to play when the user hovers over a button

    Hello

    I want a music video to play when the user hovers over a button, but I don't want the music to start again when the user hovers over the button again. I want him to play for its entire length, does not restart if the user accidentally will be on it once more.

    Thanks in advance for any help.

    You can use:

Maybe you are looking for