Problems of Code/script Animation (character Simple market)

I'm trying to get the legs of a character to move in the direction he's going on the market, but it works correctly in one direction (upwards). I used 8 layers in my calendar with images keys and classic tweens, but I would not be shocked if it was my mistake.

I'm new to Flash as a whole but I'm much more comfortable with the coding of the animation, and for the life of me I can't understand why the character keeps glitching. Other animations seem to work when you first press A, S or D key, but they are a really quick shuffle and then the gotoAndPlay(frame number) would say that he does not want to work; It just goes back on the image that I have assigned and then stops.

Here is my code:

package {}

import flash.display.MovieClip;

import flash.events.Event;

import flash.events.KeyboardEvent;

import flash.net.URLRequest;

public class unicornWalkCode extends MovieClip {}

public void unicornWalkCode() {}

the constructor code

var dir: String = "stop";

var g:grass = new grass();

addChild (g);

g.x = 275;

g.y = 200;

var p:unicorn = new unicorn();

addChild (p);

p.x = 400;

p.y = 200;

Functions

addEventListener (Event.ENTER_FRAME, main);

main function (e: Event): void {}

moveUnicorn();

}

//////

Move the Unicorn (market controls)

stage.addEventListener (KeyboardEvent.KEY_DOWN, dFun);

function dFun (e: KeyboardEvent): void {}

If (e.keyCode == 87) {/ / W}

dir = 'mounted ';

p.gotoAndPlay (175);

}

If (e.keyCode == 65) {/ / has}

dir = 'left ';

p.gotoAndPlay (125);

}

If (e.keyCode == 83) {/ / S}

dir = "down".

p.gotoAndPlay (25);

}

If (e.keyCode == 68) {//D

dir = 'right ';

p.gotoAndPlay (75);

}

}

stage.addEventListener (KeyboardEvent.KEY_UP, uFun);

function uFun (e: KeyboardEvent): void {}

If (e.keyCode == 87) {/ / W}

dir = "stop";

p.gotoAndPlay (175);

}

If (e.keyCode == 65) {/ / has}

dir = "stop";

p.gotoAndPlay (100);

}

If (e.keyCode == 83) {/ / S}

dir = "stop";

p.gotoAndPlay (1);

}

If (e.keyCode == 68) {/ / D}

dir = "stop";

p.gotoAndPlay (50);

}

}

/////////////////////////////////////////////////////////////////////////////////Function s

Move the Unicorn

function moveUnicorn(): void {}

If (dir == 'up' & & p.y > 0) {//Facing BACK

p.y-= 3;

}

If (dir == 'left' & & p.x > 0) {}

d.x-= 3;

}

If (dir == 'down' & & p.y < 400) {}

p.y += 3;

}

If (dir == 'right' & & p.x < 550) {//Facing FRONT}

p.x += 3;

}

}

Finally three braces

}

}

}

I double checked the chassis numbers and they have all the rights, as well as the numbers of images in my orders gotoAndPlay. :/

The answer is probably right in front of my face, but I can't seem to understand.

I appreciate any suggestions!

It doesn't matter where you place the comments.  It's the rest of your code that is problematic.

You should have something like

package {}

import flash.display.MovieClip;

import flash.events.Event;

import flash.events.KeyboardEvent;

import flash.net.URLRequest;

public class unicornWalkCode extends MovieClip {}

var dir: String = "stop";

var g:grass = new grass();

var p:unicorn = new unicorn();

var keydownBool:Boolean;

public void unicornWalkCode() {}

the constructor code

addChild (g);

g.x = 275;

g.y = 200;

addChild (p);

p.x = 400;

p.y = 200;

Functions

addEventListener (Event.ENTER_FRAME, main);

stage.addEventListener (KeyboardEvent.KEY_DOWN, dFun);

stage.addEventListener (KeyboardEvent.KEY_UP, uFun);

}

main function (e: Event): void {}

moveUnicorn();

}

//////

Move the Unicorn (market controls)

function dFun (e: KeyboardEvent): void {}

{if (KeyDown)}

return;

}

KeyDown = true;

If (e.keyCode == 87) {/ / W}

dir = 'mounted ';

p.gotoAndPlay (175);

}

If (e.keyCode == 65) {/ / has}

dir = 'left ';

p.gotoAndPlay (125);

}

If (e.keyCode == 83) {/ / S}

dir = "down".

p.gotoAndPlay (25);

}

If (e.keyCode == 68) {//D

dir = 'right ';

p.gotoAndPlay (75);

}

}

function uFun (e: KeyboardEvent): void {}

KeyDown = false;

If (e.keyCode == 87) {/ / W}

dir = "stop";

p.gotoAndPlay (175);

}

If (e.keyCode == 65) {/ / has}

dir = "stop";

p.gotoAndPlay (100);

}

If (e.keyCode == 83) {/ / S}

dir = "stop";

p.gotoAndPlay (1);

}

If (e.keyCode == 68) {/ / D}

dir = "stop";

p.gotoAndPlay (50);

}

}

/////////////////////////////////////////////////////////////////////////////////Function s

Move the Unicorn

function moveUnicorn(): void {}

If (dir == 'up' & p.y > 0) {//Facing BACK

p.y-= 3;

}

If (dir == 'left' & d.x > 0) {}

d.x-= 3;

}

If (dir == 'down' & p.y)< 400)="">

p.y += 3;

}

If (dir == 'right' & p.x)< 550)="" {="" facing="">

p.x += 3;

}

}

}

}

Tags: Adobe Animate

Similar Questions

  • audio sync problem and cc animate animation

    1. more audio / timeline that includes a slide, most animations will play out of sync because the blade continues to play. the animation seems to be trolling the audio at the end of the slide.

    Executives jump script is certainly a problem, but I have ways around it without having to cut the audio. Suppose you want to trigger a code engine animation after 2 seconds of frame skipping, and you want to stop jumping images after 10 seconds, this kind of approach works well (this example is 24 frames per second, changing 24-other values for other frame rates):

    var starttime is createjs. Ticker.getTime ();

    var firstframe = this.currentFrame;

    createjs. Ticker.setfps(25) (24);

    createjs. Ticker.addEventListener ("tick", movealong);

    self = this;

    setTimeout (CodeAnim, 2000);

    setTimeout(AtEnd,10000);

    This.Stop ();

    function movealong() {}

    var = now createjs. Ticker.getTime ();

    var f = Math.floor ((now-starttime) / 1000 * 24 + firstframe)

    self.gotoAndStop (f);

    }

    function CodeAnim() {}

    set the animation code course

    }

    function AtEnd() {}

    createjs. Ticker.removeEventListener ("tick", movealong);

    }

  • Code/script to extract all the text in the Illustrator document?

    Any who have code/script for this, or how to create the code to extract all the text on an active document in Illustrator. Extract the text as the text for any and all text elements in the document (TextFrameItem, TextRange, TextPath, etc.). We can just empty the text with alerts().

    I'm not sure of is what order or hierarchy to retrieve the text. Where do we start from activeDocument.textFrameItems/TextRanges/etc. How are text in Illustrator? I'm new to Illustrator scripting.

    Something as simple as that can do the trick.

    It will act on all open documents.

    you could then create a file and write to this alert, rather then just

    for(var i = 0; i < app.documents.length; i++){
        for(var j = 0; j < app.documents[i].textFrames.length; j++){
            var str = app.documents[i].textFrames[j].contents;
            alert(str);
            }
        }
    
  • Problem of calculation Script

    Hi all



    I have the following calculation script:

    UPDATECALC OFF SET;
    SET AGGMISSG

    Fix (& CurVersion,
    & BudYr,
    localcur,
    @Relative (@MEMBER (@CONCATENATE (@SUBSTRING (@Name ([Department]), 0, 3), "_A01")), 0),
    @Relative("All_Products",0))


    Fix ("dirty", @relative(Expenses,0), Jan: DEC)


    Budget)

    If (@isuda ('entity', 'New'))

    Budget = real-> final-> & PriorYr;

    endif
    )

    endfix
    endfix


    I want to copy the real-> Final data budget-> work only for the entities marked with UDA 'new '.

    I can't use datacopy command I use if statement.

    There are 2 problems with these scripts:

    1. it does not create the blocks for the new budget year since we don't use datacopy

    2. If I try to use create custom block missign it opens too many blocks in the Essbase database.

    How can I change the code above to achieve this datacopy resolve these two issues I have mentioned.

    Thanks for your help.

    Two thoughts:
    (1) create new UDAs, for example, NewA1, NewA2, etc. A pain, but it could be done.
    (2) I think that this has been suggested before, but I don't know if it would really work: DIFFICULTY (@RELATIVE ("Division_A1", 0) AND @UDA ('entity', 'New'))

    Kind regards

    Cameron Lackpour

  • Problem with Calc Script - if

    All, Hy

    I guess it's really simple, but I have no idea how to solve this problem.

    The Script looks like this:

    "View segment.
    (IF (@SUBSTRING (@NAME(&REPORTING_MONTH), 0, 3) = "M07")
    'Segment View' = 'Segment View'-> 'real ';
    ENDIF ;)


    I get the Error Message:

    "Error analysis [view Segment] (line xxx) formula: [()] without [)].

    Someone at - it an idea how to solve this problem?

    Kind regards


    Joerg

    Published by: Blue Raven on 19.08.2010 02:29

    Try this. It can works

    "View segment.
    (IF (@ismbr (@match ('Period', ' M07 * "" ")) and @ismbr (& REPORTING_MONTH)))
    'Segment View' = 'Segment of view'-> 'real ';
    ENDIF ;)

  • lately and I don't know why I see a pop up of a problem with the script. can some1 help me?

    There is a pop up of a problem with the script. He asked end and contuniue the script. I didn't have this problem before. Please help me this is getting really annoying. He asks a lot

    I changed a theme and almost never have a problem again...

  • Satellite U300 - 111 - device with problem of code 10

    My cousin has a Satellite U300-111 and she is having the problem of code 10 "this device cannot start.
    It formatted his cell phone, and then the noise disappeared. She tried the soundcard that she found on toshiba.com but nothing seems to work. !

    Could someone find us please a solution coz, she is really give up now?
    Thanks in advance

    Hello

    Your message is not clear
    You said that the laptop has been formatted Ok have you installed all the drivers from Toshiba?

    You must use the European driver of Toshiba page to download driver.
    The laptop seems to belong to the PSU30E. You should choose exactly this model in the form of download number.

    But these drivers are only required if you have installed a clean Windows operating system.
    If you use the Toshiba Recovery CD/DVDs you n t need the drivers because the image already contains the Toshiba drivers.

    Concerning

  • I have a device (driver) there appears the following message: Windows ha dejado device porque este is encontraron problemas. (Code 43)

    I have a device (driver) there appears the following message: Windows ha dejado device porque este is encontraron problemas. (Code 43)

    por ese reason no he could use mi tarjeta grafica g-force 8500 gt if alguien sabe como ese problema did to lo thank

    Hello

    See this page to select your language:

    http://support.Microsoft.com/common/international.aspx

    ====================================

    Or sorry that it is area English.

    Left click at the bottom of the Microsoft Community page

    English and set your language.

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Fix It Center request "Please enter your product code for 36 character" for an installed program

    FIX COMPUTER CENTER REQUEST "PLEASE ENTER YOUR PRODUCT CODE FOR 36 CHARACTER" FOR A PROGRAM INSTALLED.   How and where can I find it?

    Who solve this running?

    What is the program install and uninstall tool? http://support.Microsoft.com/mats/Program_Install_and_Uninstall

    There is more information about this tool here: http://blogs.msdn.com/b/astebner/archive/2011/11/23/10241056.aspx

    You can use the program which is linked to on this page to the list of installed programs and their product codes:

    http://blogs.msdn.com/b/astebner/Archive/2005/07/01/434814.aspx

  • Error: "Windows has stopped this device because it has reported problems. (Code 43)

    Original title: chip Blue tooth

    Summer just check via the Device Manager and found my 'CSR Bluetooth Chip' has a problem: "Windows has stopped this device because it has reported problems. (Code 43)' checked the update driver and it's all good, no matter what can shed light on this problem?

    Hello Brady.

    Thanks for posting your concern to Mirosoft forum, I'll certainly help you with this problem.

    You might face this problem because damaged or obsolete Bluetooth drivers. I suggest you follow the steps below and check if it helps.

    1. Did you of recent changes to the computer before this problem?
    2. When you receive this error message?
    3. Your computer will detect the Bluetooth device?

    Please follow the methods and check the status of the issue.

    Method 1: Run the diagnostic tool

    The diagnostic tool is a tool that will check the hardware attached to the computer for all known with him of the issues and provides details and how to fix them. Follow these steps and run the troubleshooter.

    Connect the devices to the computer.

    Hardware devices do not work or are not detected in Windows

    If the problem persists, follow method 2.

    Method 2: Uninstall and reinstall the Bluetooth driver.

    Follow the steps below to uninstall the Bluetooth driver.

    1. Click Start
    2. Click on Control Panel.
    3. Go to system and security.
    4. Under System , click Device Manager.
    5. You can get driver Bluetooth and expand it.
    6. Right click on the driver Bluetooth and select Uninstall.
    7. Now, restart the computer and check the status of the Bluetooth driver.

    See also:

    Code 43: Windows has stopped this device because it has reported problems

    Devices & drivers

    Let us know if you need more assistance. We will be happy to help you.

    ____________________

    Thank you best regards &,.

    Isha Soni

  • Ports USB 43 problem error code

    On a port USB is not recognized. Error code 43. I have four USB Port on the laptop. Three on the left and right and the other on the back. All have failed to recognize the devices. I tried in vain to run the programe "Fix it." Operating system is Windows 7 Ultimate

    Hi CosmosOmondi,

    What is the number and the model of your laptop?

    Windows has stopped this device because it has reported problems. (Code 43)

    Method 1: Reinstall the USB (Universal Serial Bus) controllers.

     First of all, please disconnect all USB devices and then perform the following steps:

    (a) click on 'Start', type device manager in the search bar and press "Enter." If necessary, click on continue.

    (b) in Device Manager, double-click to expand the "USB Bus controllers", right-click on the "host controller", click "Uninstall" and click "OK".

    (c) repeat step 2 to uninstall all items under 'USB Bus controllers'.

    Then, restart your computer and windows will automatically reinstall all USB controllers.


    Method 2:
    the motherboard\chipset to the latest driver update.

    Note: Please check with the manufacturer of motherboard\computer before you install the driver.

    Method 3: You can see the steps mentioned in the link below

    Tips-for-solving-problems-with-USB-devices
    http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-solving-problems-with-USB-devices

    (Article applies to Windows Vista, not valid for Windows 7)

    Method 4: You can view the documentation for the hardware for more information about diagnosing the problem.

  • peripheral Bluetooth, Windows has stopped this device because it has reported problems. (Code 43)

    my bluetooth device does not work and this is the message I get:

    Windows has stopped this device because it has reported problems. (Code 43)

    Windows has stopped this device because it has reported problems. (Code 43)

    Diagnosis

    A device driver has notified the operating system that the device failed.

    Hardware devices do not work or are not detected in Windows FIX IT:

    http://support.Microsoft.com/mats/hardware_device_problems

  • AMD Radeon HD: Windows has stopped this device because it has reported problems. (Code 43)

    In my device manager, in graphics cards, for my AMD Radeon 7500,7600 M graphics card in the series, the properties display the following error message:
    "Windows has stopped this device because it has reported problems. (Code 43) »

    I uninstalled the drivers and reinstalled them - it's the 12.104.0.0 version, which I have confirmed is the last. I have the Catalyst Control Center installed as well.

    Can someone help me understand this error? Why would he stop? What would be my next steps to try to solve it?

    See you soon,.

    Sam

    Hi thanks for trying, but the Dell drivers are those which deal with the problem of restart.

    I find the most recent driver Intel HD 4000 (Win64_15313_intel) and installed version, then I installed the latest drivers AMD (13-4_mobility_win7_win8_64_dd_ccc_whql_AMD) on the site of AMD. This solved my problems and my graphics card works fine now.

    So yes, just repeat those it tells me to install when I get my serial number and OS (Windows 7) were:

    Intel: 5423_Video_Driver_T6XGJ_WN_8.15.10.2669_A02

    AMD: 5423_Video_Driver_VGR24_WN_8.951.9.0_A02

    And these caused problems without end - the graphics card would not work, and then when I installed drivers from AMD, Dell, it would cause my system to reboot every 2 or 3 minutes. It looked like some kind of incompatibility between the two graphics cards and the drivers provided.

    The other representative of Dell told me the same thing that you - so I wanted to post my solution in case anyone else has this problem.

  • Windows has stopped the device because it has reported problems. Code 43 with generic bluetooth adapter.

    Windows has stopped the device because it has reported problems. Code 43. Something with the generic bluetooth adapter. What should do?

    Original title: Please help

    Hi JovanaNesic,

    One of the motors controlling the unit notified the operating system that the device has failed in some way.

    Try to run the hardware troubleshooter and check what the problem is and fix it accordingly.

    Follow the link below a convenience store opened.

    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter

    If you have already run the Troubleshooting Wizard, you can view the documentation for the hardware for more information about diagnosing the problem.

  • My 4 GB USB shows this error "Windows has stopped this device because it has reported problems. (Code 43) ». How do slove this problem pls tell me

    My 4 GB USB shows this error "Windows has stopped this device because it has reported problems. (Code 43) ». How do slove this problem pls tell me

    Try the USB device on another computer.  If you get the same error in another computer, then the unit has probably missed and the files that it contains are lost.

Maybe you are looking for

  • Save my tabs when Firefox is closed so that they are always there when I restart Firefox

    You have to use restore on my computer recently and once I did, Firefox seems to have lost the ability to save the tabs that I had opened since the last time that I used it, do not remember how it was configured to save tabs after each session. Also

  • yoga Tablet 10

    Good evening I bought a Lenovo Tablet Yoga 10 in March this year at the Japan. The Tablet are in meta mode. I tried to hold the botton to start and more volume, but the beginning of the Tablet again in the same mode. I'm of the Brazil and to stay in

  • Event.attendees () access number

    I'm not successful in getting the calendar event participants. No matter what I do the list is always empty. I use attendees() method on the CalendarEvent object. Can someone explain how it is suppose to work. What it means to wait and how to recover

  • Cannot use the DVDirect device

    Original title: I have a DCR - HC21 Handi Cam and need to import the vidoe off minis bands on my laptop, any suggestions (running windows 7) After spending over an hour on the phone with Sony and getting no response because the guy basically kept rep

  • what I did to do all my words on all very small Web sites and how to change this back?

    I have windows 7 and I clicked something by mistake and I don't know what I did... How can I change this back?