Help! Movement of the object of continuous when the mouse is over - ActionScript 3.

Hello! I'm working on a school project. Here is a picture of what I'm working on.

Screen shot 2010-09-18 at 7.49.34 PM.png

My cursor in this film is the heart. When I move my mouse on Hello Kitty, she jumps - but only once. How can I make him keep jumping when my mouse is above it and make its judgment jump when I pull away? Here is the code below. If you can help that would be great!

Also, because I'm new to ActionScript I might have messed up with the movement of the animation. Hello Kitty used to jump all the time without doing me anything. Then I copied the code of movement in my ACTIONS layer to the Hello Kitty object code stop(); . She is not jumping all the time, just at the time when my mouse flies over her... but she jumps only once and that's the problem. I want it to keep jumping until my mouse is above it. Help, please! Thank you!!!


Import fl.motion.Animator; I COPIED THIS MOVEMENT OF THE MOTION TWEEN ON THE CAT

"var kittyMotion_xml:XML = < time Motion ="15"xmlns =" "fl.motion. *" xmlns:geom = "flash.geom. *" xmlns:filters = "flash.filters. *" >

< source >

< source frameRate = '24' x = "8.95" y = "63.9" scaleX = scaleY '1' = '1' rotation = elementType '0' = 'graph' NomSymbole = 'Tween 1' >

< size >

< geom:Rectangle left = "-110.65" top = "-135" width = '221.35' height = "270.05" / >

< / size >

< transformationPoint >

< geom:Point = "0.49988705669753786" x = "0.49990742455100906" / >

< / transformationPoint >

< / source >

< / source >


< keyframe index = "0" tweenSnap = "true" tweenSync = "true" >

<>interpolation

< SimpleEase ease = '0' / >

< / tweens >

< / keyframe >


< Keyframe index = tweenSnap "14" = "true" tweenSync = "true" firstFrame = "14" y = "-63.55" >

<>interpolation

< SimpleEase ease = '0' / >

< / tweens >

< / keyframe >

< / motion >;


/ * var kittyMotion_animator:Animator = new Animator (kittyMotion_xml, kittyMotion);

kittyMotion_animator.play (); * /



HKITTY_mc.addEventListener (MouseEvent.MOUSE_MOVE, mouseMOVE); MOVE THE MOUSE TO MAKE KITTY JUMP


function mouseMOVE(event:MouseEvent):void {}

HKITTY_mc.gotoAndPlay (kittyMotion_xml.currentFrame);

}




other_kitty_mc.Alpha = 0;

Assign all to this other_kitty_mc event listeners, but have orders in the functions target the hkitty_mc you already have.

Tags: Adobe Animate

Similar Questions

  • Move the container sprite as the movement of the mouse

    Hi all

    I am developing a game where there is an object that follows the mouse. There are also other objects and a map on the screen. I feel like any content background (the entire map and other items) to move when the user moves the mouse to the left or to the right. In other words, if the user moves the mouse on the right side, then all content (with the exception of the object which moves according to the mouse) must move left so that the user can see part of the map on the right side.

    From now on, I created new sprite container in which I added all my objects and map. So when the user moves the mouse to the right, I move the container sprite to the left so that it looks like all things moves to the left. Code looks to as below

    var pt:Point = new Point (character.x, character.y);

    PT = dori.localToGlobal (pt);

    If (pt.x > (stage.width * 0.5))

    {

    Container.x-= 5;

    }

    The project structure is such that I add container directly to the stadium. and this container contains just like the card, character and other objects.

    Now the problem is that as soon as the mouse goes beyond middle of scene... it creates distance between the location of the mouse and the character... !! I mean it moves according to the mouse but some distance will be created between the mouse and character. and continues to increase this distance that I continue to move the mouse to the center of the stage!

    I'm really stuck with this problem. Please someone help with this. I hope I've explained that well. I would like to know if you need more information, but please help.

    use linear interpolation to determine how your objects should move.  for example, if when the mouse is at x = stage.stageWidth, bg should be stage.stageWidth - bg.width and when the mouse is in x = 0, bg must be 0 use:

    paramF (bg, stage.stageWidth, stage.stageWidth - bg.width, 0, 0);

    in a loop that updates with the movement of the mouse:

    BG.x = BG.m * MouseX + BG.b;

    function paramF(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):void {}

    MC.m =(Y1-Y2) /(x1-x2);

    MC.b = Y1 - mc.m * x 1;

    }

  • Limit the movements of the mouse in Authorware

    Hi all


    I try to limit the movements of the mouse of a user in Authorware. So far, I was able to do something that changes the cursor when it is over a square (mobile area). However, I missed out yet how to limit the mouse to go outside the edge of the square. Thinking has been to follow the point where the user has left the square with the cursor and set CursorX and CursorY to these values. However, these system variables cannot set a value, read only (AFAIK). Did anyone have any suggestions?

    Kind regards

    Frank

    Cannot be done with Authorware alone...

    Easy solution - use the SetCursor function to hide the mouse (4) when he leaves the defined area, set it to the arrow (0) when he enters. Don't forget to put the arrow, so when you leave the page otherwise.

    More difficult, but what you need – load the SetCursorPos of WinAPI.u32 function that allows you to actually set the cursor position... then as above, when the cursor leaves the area defined, to put back...

    Help?

    Erik

  • Movement of the mouse jerky on Z220

    Hello

    I have several Z220 (XEON E3-1225 V2) with integrated graphics Intel P4000 as additional Nvidia Quadro 600 for the operation of 4 monitors.

    Most of the time I have problems with the movement of the mouse which is very jerky. Looks like she is dependent on the content of the screen, just under the cursor while moving.

    Any idea how you can solve this very annoying bug?

    Thank you

    McL

    Problem is solved... sort of.

    The graphics in internal P4000 has problems when a Nvidia graphics card. This seems to be known and there is nothing we can do about it - unfortunately.

    I had to disable the internal chart and add a second card Nvidia to use 3-4 monitors.

    ... just in case somebody stumbles on the same...

    McL

  • Video YouTube will freeze until move you the mouse in Mozilla firefox

    My video freezes on u tube, and when I do a job in my studies online. On u tube, the video will freeze until move you the mouse, but the music will still play. And it seems that this really when in fullscreen? I use Firefox...

    Hello

    Thanks for posting in this forum. I understand that while playing video in YouTube, you are facing some problems. The web browser you are using is Firefox.

    I suggest that you try Internet Explorer and check to see if the problem persists. Post back with the error code or message.

    Assistance to solve the problem in Firefox, please contact Firefox support because they would be better suited. Check out the link.

    http://support.Mozilla.org/en-us/home

  • Stop wake up on the movement of the mouse

    Having put my computer to sleep every movement of the mouse wakes it. This can happen in just bumping the Office when you leave. This causes the computer to stay awake for about half an hour. I have a Microsoft wireless mouse. There is a way to stop this action or what I need to disconnect the receiver from the mouse to put the computer to sleep?

    Devices Open & Printers
    Right click on your mouse and select Properties
    Select the Hardware tab
    Click on the properties button
    Click the change settings button
    On the power management tab, uncheck the box "allow this device to wake the computer". Want to know if your hardware current & software will work with Windows 7? Click on these links: *Windows 7 Upgrade Advisor * *Windows 7 Compatibility Center*.

  • How can I trace the movements of the mouse and ignore the movements not

    I have a program that records the position of the mouse each 300 ms over a period of approximately 9 hour minute.

    However, I need to know the mouse ONLY when it is not the same now previous position (sometimes the user stops talking. I don't want to save 5 minutes from the same position of the mouse)

    Here is the original program

    var drawTimer:Timer = new Timer (300, 500000);

    drawTimer.addEventListener (TimerEvent.TIMER, timeSampler);

    function timeSampler(evt:TimerEvent):void {}

    {trace (mouseX, ', ' + mouseY);

    }

    }

    I tried to create a variable to capture the position of the mouse at a specific time

    var posMouseX:Number = mouseX;

    var posMouseY:Number = mouseY;

    and to add a conditional statement in the function

    If ((mouseX! = posMouseX) & & (mouseY! = posMouseY))
    {trace (mouseX, ', ' + mouseY) ;}}

    but I do not do this correctly because I no more than getting every movement of the mouse or none

    Can anyone suggest a better way to do it?

    Thanks in advance

    The code above can do what you want

    you will get the values only when the mouse is moved, there will be no duplicate values

    stage.addEventListener (MouseEvent.MOUSE_MOVE, onMove);

    function onMove(e:MouseEvent):void

    {

    trace (mouseX + "," + mouseY);

    Add your code here to save the values, for example:

    myArray.push (mouseX, mouseY);

    }

    as the timer still counting down and on full it will delete the scene event listener.

    var drawTimer:Timer = new Timer (300, 500000);

    drawTimer.addEventListener (TimerEvent.TIMER_COMPLETE, timeSampler);

    function timeSampler(evt:TimerEvent):void

    {

    stage.removeEventListener (MouseEvent.MOUSE_MOVE, onMove);

    }

    drawTimer.start ();

  • Movement of the mouse oriented in AS3?

    I need help with something.

    Basically, I try to make a platform game, I know how to move left and right with the arrow keys, but it's pretty boring.

    I want to spend my character based only on the movement of my mouse x. more I move my mouse in a certain direction, the faster the character goes in this direction. I tried to change the speed of x on my character based on an x-value of the mouse, but nothing works.

    preferably, I want a code that keeps my cursor to the center of the screen, while being able to detect the movements of the mouse x.

    I copy paste the code in my program, but I'm pretty confident that it will do so no goal. I need a new direction. I have no idea how to proceed.

    any help is greatly appreciated.

    :

    :

    speed must be greater than 0

    var speed: Number =. 01;

    Mouse.Hide ();

    var t:Timer = new Timer (100.0);

    t.addEventListener (TimerEvent.TIMER, loopF);

    t.Start ();

    function loopF(e:TimerEvent):void {}

    yourchar.x += (mouseX - stage.stageWidth / 2) * speed;

    }

  • How to open the dialog Ctrl + Tab of a script? (I want to assign to a move of the mouse)

    How to open the dialog Ctrl + Tab of a script? (I want to assign to a move of the mouse)

    Do you mean Ctrl Tab (browser.ctrlTab.previews) Preview or browser: ShowAllTabs (allTabs.open ()); command or something else?

  • InDesign objects are not locked and will not move with the mouse click.

    I rebooted, uninstalled and reinstalled. Objects interact with when the mouse is clicked. The contours of the block came and the object can be selected and changed, however it will not move with a mouse. Objects respond to the arrows when the issue is raised; but it's heavy at best.

    I gave in my computer image. What was the origin of the problem, is now gone. Thanks for your help.

  • Object and movements of the mouse on reverse limited

    I'm trying to make a more interesting background for a page that contains several objects moving slightly,
    According to the "x" coordinate of the mouse. I'm trying to limit the movement to 100 pixels in contrast to 'x' coordinates of the mouse. For clarity, I'll stick to a single object (object_mc)

    For the moment, I've been throwing around this basic code, which is very representative of what I'm trying to do, however I never did nothing about this movement.

    mouseInterval = setInterval (x_inverse, 10);
    function x_inverse () {}
    object_mc._x = Math.round ( / / / I've been plugging away and begins to believe that I have to use some kind of limitation function with regard to _root._xmouse / / / );
    }

    The idea is that, when the mouse is x = 0, object_mc is at x = 100 and vice versa. These details must also be flexible, because when the mouse is x = 1-500, 'object_mc' is x = 500-400. Thus, while the range for the "_root._xmouse" is the entire canvas, the beach to the "object_mc" would be limited to a defined area (for example, 400-500).

    Any help would be appreciated, and I would be more than willing to follow a tutorial on mine if pointed in the right direction.

    Thank you!

    the function below your movieclip movieclip and the mouse _x property returns:

  • Slow down the movement of the mouse in Server 2008 R2 - please help?

    Hi guys,.

    I installed 4.1 ESX Server and that you have installed two virtual machines that is "Windows XP" and "Windows Server 2008 R2. The problem was the slow mouse movement in two virtual machines, but this problem is fixed in Windows XP virtual machine by installingVmware tools (see: 8.3.2).) But the problem is always the same on same Server 2008 R2, I have installed vmware tools on this virutal machine too. But I don't know what is wrong? the movement of the cursor is always very slow in server 2008 R2 and I'm unable to continou my work on this machine...

    Any idea?

    Your help will be much appreciated. Thank you?  :|

    Hello

    -the value of the RAM 32 MB video

    -Install the following driver for the video card: C:\Program Files\Fichiers Files\VMware\Drivers\wddm_video

    A reboot later, that the mouse would work fine

    Best regards

    Marc

  • Widescreen = slower movements of the mouse

    I just bought a new computer with a 24 "display. When I play on Facebook Farville I can't use the wide screen because everything slow down when it does come to a stall sometimes. Where is the problem? The computer, the screen or the mouse? I tried different screen resol. complete but without success. Someone at - experienced this kind of problem before? Thank you

    Hello Rejean2002,

    To ensure that your PC is clean!  Try to start your system in safe mode:

    1. Restart your computer if it is running.
    2. Press and hold the F8 key for 3 seconds after your computer powers initially on.
    3. Once you see the Advanced Boot Options menu (or beep) you can stop.
    4. Up/down arrow keys to highlight your selection.
    5. Select Mode safe mode with networking and press ENTER.
    6. You should see drivers loading, it may take a few moments.
    7. You should then be at the Welcome screen.
    8. Connect to your computer using an account with administrator privileges. Now, you download (free) MalwareBytes from here: http://download.cnet.com/Malwarebytes-Anti-Malware/3000-8022_4-10804572.html?tag=mncol install, Update then do a scan of your system in safe mode, to ensure that it is indeed clean! Once the scan done remove anything it finds. Simply restart your PC to see if your problem has been resolved!

    If your system is clean, then run this analysis of Auditor system in SafeMode below files:

    1. click on Start, click principally made programs, Accessories, right-click on command promptand select run as administrator.

    2. click on continue or provide credentials admin if prompted.

    3. in the command prompt window type the following, sfc/scannow (yes he's a space after sfc), and then press ENTER. This analysis may take some time to complete.

    Hope this helps you. Let us know anyway. Make it a great day!

    "And in the end the love you take, is equal to The Love You Make" (The Beatles last song from their latest album, Abbey Road.)

  • movements of the mouse next to the screen

    Hello! I changed my settings of the mouse (I use the computer keyboard) and now all of a sudden, when I'm going to move it, he shakes on the right side of the screen... It makes me CRAZY! How should I do? ANY help is greatly appreciated! I use Windows 7.

    Hi Rachel,

    Thanks for choosing Microsoft Community Forums.

    According to the description of the mouse does not work in Windows 7.

    Let me go ahead and help you resolve the issue.

    To help you better, please answer these questions:

    1. What is the number of brands and models of computer?

    2 has there been any changes made on the computer before the show?

    I suggest you to follow the article provided to solve the problem of the mouse:

    Mouse, touchpad and keyboard with Windows problems

    http://Windows.Microsoft.com/en-in/Windows/help/Mouse-touchpad-and-keyboard-problems-in-Windows?T1=tab04

    Note: follow the steps in the article.

    Due to operating system Windows or anything related to the mouse, feel free to get back to us.

  • Color Photoshop image changes when the mouse hovers over it

    Hello

    I installed Photoshop on a new server and when I open an image in Photoshop displays colors incorrectly. If I then move the mouse to the images it then corrects the color. I see not why he did it because I didn't see any changes to the default settings during the installation. Does anyone know why it does this?

    If I take an extract from the image and paste it into word, the image is fine, so it is on display in Photoshop at fault.

    Any help would be greatly appreciated.

    Sean

    Hello

    now, I found the resolution to this to Photoshop when it is installed on a Citrix Xenapp server and which was to change the following registry -.

    [HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ica\THINWIRE

    "DISABLEOSSFORPROCESSES"IS"PHOTOSHOP. EXE; ILLUSTRATOR. "EXE"

    Thank you for your help.

Maybe you are looking for

  • El Capital 10.11.4 slow?

    HI guys,. Again another update from Apple and things seem bit slow for me. Anyone facing a similar question? Appears to be slow and jerky. Use of memory much more in the activity monitor and a little insensitive. Well it allows to be sweet butter eve

  • My says Mac has 4 virus and asks me to download MacKeeper. Is this a bug?

    Anyone know if this is a bug or what? I have this message and a window closed with a message saying that my Mac has 4 virus and I need to clean it, opening a Web for MacKeeper to download... Help!

  • Can someone check where exactly I'm wrong

    I do this task using sbRIO9642 and sounds and vibrations box signal (looking for manual) on FPGA Simulator using "TACH OUT" signal box thus measure the speed edge sbrio ports I'm trying to measure the speed of the fan and this is the code for this ev

  • Windows Media Player will not play a. MOV file

    I have a new Dell laptop with Windows 7 Professional and Windows Media Player will not play a '. MOV' video file completely (the video but not sound). I am told by Microsoft Windows Media Player will not play a MOV file, and I need Codec VLC add on o

  • Starting product key error

    When I start my computer, I get an error that my Windows product key is not valid. The sticker product key on the bottom of my laptop disappeared so I do not see the product key to enter. I have a Lenovo Ideapad Y450. I don't know why this error mess