Help, making the attack on character

Hello, Im trying to make my character attack, the attack animation is located in the clip of character on frame 4. But I don't understand how to do it? I want him to attack once, if you press SPACE.

I tried this:


{if (Key.isDown (Key.Space))}

this.gotoAndStop (4);

Here is my code on my MovieClip of characters

onClipEvent (load) {}

gravity = 10;

Scale = _xscale;

6 = walkSpeed;

maxjump = 0.2;

}

onClipEvent (enterFrame) {}

If (air == true) {}

FLF += gravity;

State = 3;

}

If (Key.isDown (Key.LEFT) & &! _root.leftbound.hitTest (_x, FLF, true)) {}

_x-= walkSpeed;

_xscale = - scale;

}

If (Key.isDown (Key.RIGHT) & &! _root.rightbound.hitTest (_x, FLF, true)) {}

_x += walkSpeed;

_xscale = scale;

}

If (_root.ground.hitTest (_x, FLF, true)) {}

Air = false;

} else {}

Air = true;

}

If (Key.isDown (Key.UP) & & jump == true) {}

FLF = jumpSpeed;

}

If (air == false) {}

jumping = true;

jumpcount = 0;

jumpSpeed = 22;

}

If (Key.isDown (Key.UP)) {}

jumpcount += 1;

}

If (jumpcount > maxjump & & jumpSpeed >-2) {}

jumpSpeed-= 2;

}

If (air == false & &!) Key.isDown (Key.LEFT) & &! Key.isDown (65) & & < 4 or air _currentframe == false & &! Key.isDown (Key.RIGHT) & &! Key.isDown (65) & & _currentframe < 4) {}

State = 1;

}

If (Key.isDown (Key.LEFT) & & air == false & &!) Key.isDown (65) & & _currentframe < 4 or Key.isDown (Key.RIGHT) & & air == false & &! Key.isDown (65) & & _currentframe < 4) {}

State = 2;

}

If (!.) {Key.isDown (65))}

gotoAndStop (state);

}

_root.statetxt = State;

}

onClipEvent (keyUp) {}

If (Key.getCode () == 83) {}

jumping = false;

}

}

The code you showed for the SPACE key should work.  If you try only instead of all the code you show that you should see gotoAndStop (4).  If it does not, then it is possible some other code you have is forced to do something else.  If the problem is that she goes to 4, but that he never leaves, then you need to add in another condition.

Tags: Adobe Animate

Similar Questions

  • Help about the paragraph and character styles scriptting

    Hi all

    I'm working on a project with many files, I change change on all styles of paragraph with multiple processes

    for ex, change the font for all styles of paragraph on all open documents

              var docs = app.documents;  
                     
              for (var d = docs.length-1; d >= 0; d--) {  
                      var doc=docs[d]; 
                      
    var pstyles = doc.allParagraphStyles;  
    for (var a = 1; a < pstyles.length; a++) {    
                              if (pstyles[a].appliedFont.name=="Arial\tBold")    
                                   pstyles[a].appliedFont = "Arial\tBold Italic";    
                         }
                     }
    

    but I found a text inside frames (the locked position) my find/replace a not to apply to this topic

    so, is there anyway to do this process for all chassis from locked position?

    or at least make the lock of the United Nations to all open documents, but I can only do this for the active doc

    app.activeDocument.pageItems.everyItem (.locked = false)

    Another thing, I tried to change it on all styles of character on the files and I wrote the code with my little knowledge script but it seems does not, any hint please?

              var docs = app.documents;  
                     
              for (var d = docs.length-1; d >= 0; d--) {  
                      var doc=docs[d]; 
                      
    var cstyles = doc.allCharacterStyles;  
    for (var a = 1; a < cstyles.length; a++) {    
                              if (cstyles[a].appliedFont.name=="Arial\tBold")    
                                   cstyles[a].appliedFont = "Arial\tBold Italic";  
                         }
    }
             }  
    

    Thanks in advance

    Maybe your consolidated text block... Try this

    docs var = app.documents.

    for (var docs.length - 1; d = d > = 0; d-) {}

    var doc = docs [d];

    var pgItems = doc.allPageItems;

    for (var a = 0;< pgitems.length;="" a++)="">

    If (pgItems [a] instanceof TextFrame) {}

    While (doc.groups.length > 0)

    doc.groups.everyItem () .ungroup ();

    pgItems [a] .locked = false;      }

    }

    }

  • I need help making the scale back tool in the box with tools!

    My colleague is working in AI CS3 on PC, and suddenly the scale tool is not appear in its box to tools. She may have touched a control button to clear or something:

    "I suddenly lost the ability to resize anything... a box, a text box, you name it." the selection tool will not add markers to do anything... I know I've hit something, I started and restarted... help! I have no idea how to get it back... advice? »

    She also said, that happens when it opens other files or creates a new one. She cannot access the tool of the scale at all.

    I'm on a Mac using AI CS4 off site (we are not on a network, etc.), so I don't know what happened to me. Can someone help us?

    Thank you!

    My,.

    If the tools are missing, the most likely reason is a corruption of preference.

    The opening of Illy it can press Ctrl + Alt + shift to delete and get a fresh start.

    If this does not help, or if she wants a reset reversible of preferences, it can follow the instructions in the indication move the folder here: http://www.bugge.com/Family-and-friends/Illy/illy.html.

    The name of the folder would be Adobe Illustrator CS3 Settings.

  • Need help making the DIMENSIONS of a smaller photo.

    I'm trying to post a photo JPEG on my LinkedIn page. I get a message saying that the dimensions of the photo are too big. I tried following the directions in the Windows Photo Gallery to make the picture smaller, but as SOON as I click on 'Apply' takes the smaller area I chose and breath this area more room back to the size of the original. Can someone tell me how the DIMENSIONS of a smaller photo. I don't really like it if the whole photo or a cropped the photo version. I have windows vista. Thank you!

    Rather than crop the photo... try to resize the photo...

    In Windows Live Photo Gallery... Right click on one or more
    selected inches... Choose... "Resize" in the menu. Choose
    one size, navigate to a folder to save in left click the ' resize
    Save "button. (I suggest that you save the resized pictures
    in a new folder to prevent the replacement (replacement) the originals)

    Take a look at the following link:

    Resizing Photos in Windows Live Photo Gallery
    http://blogs.msdn.com/PIX/archive/2007/11/30/resizing-photos-in-Windows-Live-Photo-Gallery.aspx

  • Do not uncheck the box "enable memory protection to help migrate online attacks."

    Original title: Internet advanced setting properties is locked can I unlock

    While checking the settings, I have double clicked on security settings, to enable memory protection to help migrate online attacks. Now it is display lite and I can't UN verifiez_ the. How can I reset to unlock and return to the display as well as others?

    Hi DJ Georgetown,.
     
    -What version of IE are you using?
     
    Login to an account with administrator rights to uncheck this option.
     
    Data Execution Prevention (DEP) is a security feature that can help prevent damage to your computer from viruses and other security threats. Harmful programs can try to attack Windows by attempting to run (also known as execute) authorized code in the memory of your computer for Windows and other programs. These types of attacks can affect your programs and files.

    DEP can help protect your computer by analyzing your programs to make sure they use the memory of the computer safely. If DEP notices a program on your computer using memory incorrectly, it closes the program and notifies you.

    Microsoft does not recommend disabling security DEP settings. But still if you need, you must be an administrator to disable the DEP settings.

    You can use the following parameters to change data execution prevention settings.
    • Click the Start button and right-click on my computer and choose Properties.
    • Now you need to click on advanced system settings
    • Now, go to Performance and click settings.
    • Now, go to Data Execution Prevention and just click on turn on DEP for all programs and services except those I select.
    • Now, choose the program of desire to which you fork DEP. When you are finished, click OK.
    • Restart your computer.

    For more information, see:

    A detailed description of the feature Data Execution Prevention (DEP) in Windows XP Service Pack 2, Microsoft Windows XP Tablet PC Edition 2005, and Windows Server 2003

  • Making the ear of corn and need help with the ball.

    I do some corn on the COB for an illustration and I need help with the texture of the ball. I've been slowly making progress with gradient for kernels mesh, but I can't seem to recreate the look of the ball at all. I tried to recreate it in a rectangle by using the option in the menu object (1 row, 50 columns) gradient mesh and I'm trying with the fusion in object mode, but not lucky yet. Can someone help to put me on the right track to make the texture:

    http://images.clipartof.com/sweet-corn-on-the-cob-with-husk-royalty-free-vegetable-stock-photo-by-kennygadams-4501068853.jpg

    http://image.shutterstock.com/display_pic_with_logo/660550/660550,1298544740,8/stock-photo-ripe-corn-vector-illustration-on-white-background-71847955.jpg

    http://static5.depositphotos.com/1012047/533/v/950/depositphotos_5336961-Corn-oil.-Stylized-drop-of-oil-and-corn-cob..jpg

    I've been slowly making progress with gradient for kernels mesh, but I can't seem to recreate the look of the ball at all.

    Tank,

    You have published three images stylistically very different. The first is photographic and call probably (but not necessarily) for graduates of mesh. The other two are graphical treatments (and frankly, they're both rather flat; lack of depth).

    Illustration style extends the range of cartoonish in sketchy photo-realism and all the rest. The problem is you didn't show your own attempt so that anyone can have an idea of what you're trying to achieve the stylistic point of view.

    I just need to put in place so that the final step does not appear the whole box. The problem now is trying to make the style of the good brush to reproduce the effect...

    You seem to think you have to build a kind of linear construction and then find a way to reshape the shape of each part of the leaf. Yes, you pouvez approach it this way, but Illustrator users has often tend to be what aunt Molly would call "too clever by half."

    Not everything must be something semi intelligent auto or complex and tedious consruct involving brushes, envelopes, masks, etc, etc. Much can be accomplished by thinking that he just thanks to measure you draw directly economic paths and constructions, which take no more time (often less) and result in very tidy, simple files. Again, a lot depends on what you are trying to achieve the stylistic point of view. But here's an example that only took a few minutes to draw:

    If the above consists of:

    Three roads closed, 8 points each, with ordinary linear degrees

    Three mixtures of open path with three anchor points for each key path

    Six paths closed for shadows / highlights, with 19 points in total

    Mixtures being directly from the paths drawn comic forms, the spacing of the veins 'automatically' and intuitively follows the width from point of view of the worksheet.

    Rather than to build a boilerplate brush, colouring and the weight of each of the three main paths of the vein mixtures can be set individually at any time, simply directly by selecting the key path.

    JET

  • Choose the UTF-8 character encoding

    I've had problems in the last two weeks, resulting in the page crashes, Force stops, restarts, and I have no idea of what was the cause. I have updated Flash and Java and Mac. DoubleClick/eBay javascript files have appeared on my desk, for unknown reasons. In desperation, I decided to change coding in Safari in Unicode UTF-8, and for this reason, or as by chance, the problems seem to be outstanding. Cause or coincidence? Can anyone shed any light my way?

    Furthermore, I tend to use the values by default as much as possible because I don't know what my meddling would do.

    I know that Unicode is an important choice developers must take into account when writing pages but it's a good choice for end users like me? It choose in preferences does web pages behave differently in Safari?

    Nowadays almost all web pages should have code in it that tells all browsers to automatically switch to utf-8 or other coding.  Default for th browser settings have no effect when the author of the web page mistakenly forgot to include any character set = statement in his code.  So, normally, it would be unimportant.  But if it helps with the pages you look at, by all means use it.

    Another possibility is when a page is on a badly configured server that tells the browser to use a set of different characters, such as Latin 1, when the page is labeled utf8.  I hope that should also be very rare these days.

  • iPhone iOS 9.2.1 5 c screen flickers once in a while. It's okay if I use an app or text my screen flickers and is based on an application or if I TEXT it random characters of text. Help solve the problem

    Title says it all. I need help with the issue fixed.

    Making a reservation at your nearest Genius Bar - Apple Store - analysis is free

    If no Apple store nearby, take it to the Apple authorized service provider - they establish their own assessment policies > https://locate.apple.com/

    Apple does NOT endorse them, but there are folk of 'independent' service which can do a very good job (caveat emptor)

  • I need help with the program of Photos on my macbook pro

    I use a Macbook Pro with OS of Yosemite. I really need help with the Photo program. I never really got the hang of IPhoto and now that it's a new program, I'm really confused. Where can I go to learn this without waiting for the next workshop in a local store?

    Hi, I'm fighting to open same mine, making a new software update

  • HP MINI 110: SOMEONE CAN HELP ME THE PASSWORD FOR MY HP MINI 110 COMPUTER CODE IS CNU92644HS PLEASE :(

    CAN SOMEONE HELP ME THE PASSWORD FOR MY HP MINI 110 COMPUTER, CODE IS CNU92644HS PLEASE

    CNU92644HS

    @JEYSON25

    Enter: e9lo7gvvzn (3rd character is a case of lwer L)

    Kind regards

    DP - K

  • Series parity errors, and clearing the error replacement character

    I have a situation where I have to change the parity on the last byte of an outgoing message.  E problem is that when I try to play, I get a parity error and the error replacement character appears in the output.  I have a few extra bytes and a few bytes lost due to masking.  This thread stated that visa 3.4.1 there is a configuration INI directive which would disable the error replacement character.  I installed 4.4.1 and were not able to make it work properly.  I'm curious to know if anyone knows if this setting without papers is always available and how to make it work.

    Thank you.

    Thanks to Tyler of OR helped me to determine the appropriate location to use.  The entry is valid, I just used the wrong visaconf.ini file.  The correct file is located in
    (\All Users\Application Data\National Instruments\NIvisa.)  Adding the following disable replacement of the error and give the data seen by the prot series:

    [ASRL-RSRC-ALIAS]
    DisableErrorReplacement = 1

  • Need help using the access list blocking a single IP address

    Basically, I'm being attacked by a massive spammer. I managed to deny him access to our mail server, however, his repeated attempts to connect to the same server is in our file of e-mail magazine. What I want to do is set up a block for its specific IP address in our 2621 router. I tried a few different combinations using access-list, but nothing helped. Can anyone suggest something? Thank you!

    Joe

    Joe,

    If you know that the attack came from a particular ip address, you can create an extended access list and deny that IP.

    access-list 101 deny ip host host of attacker_ip_address e-mail_server_ip

    If the source ip address is random then you must put a sniffer or take a look in the syslog to see if there are any model ID as a string. You can then configure NBAR on the router to mark the package and then drop the packets.

    Here is a link that explains the procedure:

    http://www.Cisco.com/en/us/NetSol/ns110/ns170/ns171/ns128/networking_solutions_white_paper09186a008009c8ad.shtml

    Thank you

    Renault

  • Need quick help! The use of tables

    I just started using flash a few weeks ago, and for one of my school projects I am creating a pokedex which will display information, when the user clicks on some buttons. for example 'If you click the attack button, then 4 attacks will appear. I currently use frame skipping to my application; but my teacher suggested I use tables to make them all appear on a single image, but I don't know how to do this. Can anyone help?

    Thanks in advance.

    Tables are variables that contain several elements. A common use for tables is to make collections of items so that items can be related to each other by their relative position in each table. For example:

    var letters: Array = new Array ("A", "B", "C", "D");

    Table of figures: var = new Array (1,2,3,4).

    Now, you can find an element in a table by searching for here:

    var thisOne:int = letters.indexOf ('B');

    trace (thisOne);

    var thatOne:Number = numbers [letters.indexOf ('B')];

    trace (thatOne);

    The first trace shows that the letter B is in position 1 of the table letters. The trace of the second shows that the item in the table of figures in position 1 is number 2.

    Who help me? You can learn more about the use of arrays in Flash here: ActionScript 3 fundamentals: paintings | Adobe Developer Connection

  • How do you keep the guests on their hosts (no migration) by making the food stops.

    I apologize in advance for the length of this post.

    In general do not much poster, but a lot of reading.  First of all, let me tell you that I'm not a GURU PowerCLI, never written one in my life, but there is always a first time.

    Background:

    Under VMWare 4.1, that us did not run with HA, for whatever the reason why I don't know.  We had (our UPS manufacturer) Liebert software called MultiLink that when there was a power outage after 15 minutes would run a .bat file on the server vCenter for windows that would log on to the vmware host and run a file .sh that accumulate all the machines on the host and start making judgments on them.  Once completed the host itself would make a stop.

    Currently:

    Improved 5.5 VMWare vCenter, have HA and followed now host active in the configuration. We find that we can follow is no longer the practice that we have done less than 4.1.

    I got a new version 4.2.4 and that it contains, there is provision in interface with VMWare through the PowerCLI and it stops all guests on the host computer. The host then stops.

    I suspect STRONGLY that when the command is issued to stop the host itself, HA or monitoring kick and migrates customers and/or models out of the machine, before the machine shutsdown.  In the first tests, I had a host with 5 models, 1 windows machine and a Virtual Appliance on it.  Everything was arrested, as was that it was supposed to, but the host was brought back to the top he had nothing on it.  Models and machines had been moved (spread) for the two other machines.

    This has been confirmed in another test on 01/05/2015 through vCenter client connection, the guests have been stop, the by refreshing the screen you could see the machines leave the test machine, then the server itself, stop.  In a subsequent test, I commented on the "Shutdown the ESX hosts" part and the machine down and remained where they were.  So I'm guessing that it has something to do with HA, surveillance or other thing that needs to be defined differently for him to stop guests from the host, stop the host, BUT not to migrate comments to others running machines.  Do I need to enter the maintenance or standby mode before making the shutdown command?

    Any help would be greatly appreciated.

    You can avoid the confirmation prompt by adding the -confirm: $false pass.

    What follows will check all clusters and those where the priority of restarting is not disabled, is set to disabled.

    Get-Cluster |

    where {'ClusterRestartPriority', 'High', 'Medium', 'Low' - contains $_.} HARestartPriority} |

    HARestartPriority-set off Cluster - confirm: $false

    In this way, HA will continue to function (for ESXi other nodes in the cluster), but virtual machines will remain on the crux of ESXi, you stop.

  • Need to get all the text of the particular applied character style

    Can someone help me I need to get all the texts of the particular applied character style

    app.findTextPreferences.appliedCharacterStyle = 'style1 Character. "

    app.findTextPreferences.appliedCharacterStyle = 'style1 Character. "

    var mf = app.activeDocument.findText ();

    var myText = ";

    for (var i = 0; i)<>

    myText is myText + mf [i] .silence;.

    }

    Alert (MyText);

Maybe you are looking for