How Would One Go About Making an Object Rotate to Face in Direction of Mouse?

I'm just a teenager who happens to have Flash as part of CS4 Production Premium, which I got as a gift.  I don't have any training or previous experience in Flash, and have only just in the past few month been looking into what ActionScript is.  I've just been fiddling with Flash in my spare time, just as something to do, and am working on making very basic computer games.  Currently I am trying to make a very basic top-down shooter computer game.  I've gotten it to where I can move the player (a circle with an arrow on the edge) in eight directions using the standard FPS movement keys (W,A,S,D) and make it move faster for a limited time by holding down the SHIFT key. 
But now I've come to a standstill.  I am trying to make the player rotate in the direction of the mouse cursor (made to look like crosshairs) so that the player can move in any of the eight directions and aim in any direction at the same time.  I've searched the Internet for hours on end, looking for anything that might help, but not a single Web page section relates to this kind of thing.  So now I'm giving up on searching for a help article, and am making one instead.  Is there anyone that's successfully done this kind of thing before?  Or at least someone who actually knows how to properly use ActionScript 3.0 and can figure it out themselves, then tell me what they did?   (In the meantime, I've made it so that the player rotates and faces in the direction he is traveling in.)
I've attatched all the code that I've typed to make the game work, so that anyone can look at it and tell me if I'm doing something wrong already.  I've only been learning ActionScript by figuring it out on my own as I go (watched a few videos I have on a disc too), and in the case of this game, I've just been making is up as I go, so to all of you people who actually know this stuff pretty well, this code is probably going to look nasty.

I pasted it to the bottom of my code on the main timeline (correcting it for my use), but I get this message in the Compiler Errors window:
Warning: 1090: Migration issue: The onMouseMove event handler is not triggered automatically by Flash Player at run time in ActionScript 3.0.  You must first register this handler for the event using addEventListener ( 'mouseMove', callback_handler).
So what do I do about that?  (again, I'm just a beginner, so I don't know what any of this means)
(attached is a snapshot of the various objects refered to in the code.  also the original code is attached to the original post.  in case these help at all.)

Similar Messages

  • HT1040 I must not have chosen a hard back book when I started my project of creating a photo book. When I go to buy the book it only allows a small soft cover book. How would one go about changing it to a hard back book?

    I must not have chosen a hard back book when I started my project of creating a photo book. when I go to buy the book it only allows me to buy the small soft cover book. How would one go about to chage the settings?

    What version of iPhoto?
    THe basic answer to duplicate the book as things may change when you change size, select themes again and pic the cover and  size you want -
    Before ordering your book preview it using this method - http://support.apple.com/kb/HT1040 - and save the resulting PDF for reference - the delivered book will match it.
    LN

  • How would I go about making a gradient overlay in AE

    So, I recently made the move from Lightworks over to the Creative Cloud suite and I'm trying to figure out how to accomplish some of the same effects that I had produced in Lightworks. I can figure out most things that I need to do in Premiere Pro on my own, but I'm having trouble trying to figure out how to reproduce an animated image overlay. Put simply, the steps are:
    1. Gradient slides into the viewing area and the entire height of the screen from the right side and goes about 35% of the way from right to left during the animation.
    2. While the gradient is fading in, icon images of game materials are slowly fading in.
    3. Text describing the amounts of each item needed are are also slowly fading in during this time.
    4. After about 2 seconds, the gradient stops advancing from right to left, the text is @ 100% opacity and so are the icon images.
    5. This lasts about 6-8 seconds with the information fully visible on the screen.
    6. The process reverses itself, and everything fades out over the same 2 second time period.
    An example of exactly what I'm referring to is here (linked to correct timecode just before animation @ 1:12 seconds): Gradient Overlay Animation in Action
    Its a very simple animation at its core. I may just be looking around in the wrong places or using the wrong keywords (I'm very new to Adobe overall) so I'm not sure exactly where to start with these kinds of effects. Really, what I need to know is what tools or animation effects do I need to acomplish the gradient portion. I assume the other items are just titles and image keying, but the gradient I haven't figured out.
    Also, is this simple enough it can be done in Premiere, or am I better off using AE to accomplish this. Ideally its something I would want to reuse as a preset if possible to use in future videos and I may pretty it up and make it more stylized, but I really just need to figure out how to go about making the gradient animation for now.

    I would create a shape layer with a gradient fill. The gradient would have both color and opacity adjustments so that the opacity on the left edge was 0 and on the right was somewhere between 50 and 80.
    Then I would add a soft edge linear wipe on my text layer.
    Place both layers in their final position and adjust blend modes if necessary to get the look you want.
    Parent the text layer to the shape layer
    Animate the shape layer position to move it off screen to the right
    AE BASICS are the only things used in creating this kind of effect.

  • How would i go about making this?(menu where i can select options)

    http://i195.photobucket.com/albums/z100/micro5797/Kommitted/webpage.jpg
    I look at a lot of web pages looking for things that i would like to impliment into my web site. I came across this.
    I want to be able to have an expandable menu where i can choose different options.
    I don't know what this would even be called. That would be a good start, just knowing what it is called so that i can search further for it.
    Is it a type of a spry menu bar?
    Is this a widget of sorts?
    If anyone knows of a tutorial of how to do this, would you pleas post a link? Thanks.

    Thank you all for your helps and comments. It will take me a while to get through all of this information as i
    am learning it as i go. I will at a later date add the stars and check the answered question.
    @Brad Lawryk
    Even though the tutorial link that i posted is too simple for what i am trying to do. I am going through it via DW just to learn. I am starting to see what you are talking about in your posts. Thanks.
    @Nancy O.
    I was hesitant on posting a link to someone elses website as i am not trying to rip off/copy some one else, but make something similar, with my own ideas.
    http://www.digitalstormonline.com/comploadsaved.asp?id=430998

  • How would i go about making a paralax scroller in actionscript 3.0?

    i have a page with too much information on it i wanted to do something that was origanal to my site.  so i picked a paralax scroller  so that windows with different  conetent on them and make a movie clip out of each perhapps in an embedded movie clip and as i scroll change the "y" axis to move the movie clips and not change the actual page itself i would imagine it would be an event listener for a mouse scroll, but what about a scroll box? if i want a scroll box on the side as well as the event listner to create the paralax scroller?

    Can you explain what about your intentions relates the term "paralax"? 
    What directions are things going to be scrolling, vertically or horizontally?  Saying you will change the y axis isn't clear to me, since an axis is normally fixed to a location. 
    Also, what are you calling a "scroll box"? 

  • How would you go about making this in LiveCycle?

    Hi everyone,
    I need to make the shape attached in LiveCycle for one of my forms. I can not figure out what the best way to tackle it is. If I draw the rectangle, then cut it with a line, I still am stuck having to fill the entire rectangle one color.
    Your suggestions are much appreciate.
    Thanks!!

    Hi,
    this is possible with a textfield.
    Caption positioned above.
    Borders are visible with rounded corners and filled with blue.
    Appearance is customized with visible borders, rounded corners, fill color white.
    You need to manipulate the XML-source to get to look you explained.
    Select the textfield and switch to XML source view.
    Then remove the bold parts of the source code.
    <corner join="round" radius="5mm" thickness="0.3mm"/>
    <corner join="round" radius="5mm" thickness="0.3mm"/>
    <corner join="round" radius="5mm" thickness="0.3mm"/>
    <corner join="round" radius="5mm" thickness="0.3mm"/>
    As result you get.
    Here an sample file:
    https://acrobat.com/#d=0gwoBB7OE0enmnQi5bFcCA
    Radzmar
    http://thelivecycle.blogspot.com/

  • How would you go about making an html5 OS?

    I've seen it done, but I have no idea how people do it.  Anyone have any clue?

    Hi,
    this is possible with a textfield.
    Caption positioned above.
    Borders are visible with rounded corners and filled with blue.
    Appearance is customized with visible borders, rounded corners, fill color white.
    You need to manipulate the XML-source to get to look you explained.
    Select the textfield and switch to XML source view.
    Then remove the bold parts of the source code.
    <corner join="round" radius="5mm" thickness="0.3mm"/>
    <corner join="round" radius="5mm" thickness="0.3mm"/>
    <corner join="round" radius="5mm" thickness="0.3mm"/>
    <corner join="round" radius="5mm" thickness="0.3mm"/>
    As result you get.
    Here an sample file:
    https://acrobat.com/#d=0gwoBB7OE0enmnQi5bFcCA
    Radzmar
    http://thelivecycle.blogspot.com/

  • How would I go about making an event secure?

    There doesn't seem to be a way through the actions dropdown.
    Any help is appreciated.
    Thanks
    Andrew

    Hi Andrew,
    The way to accomplish this is to...
    1) Create the event
    2) Create a page and apply the event to it (use the toolbox to instead the event as module tag)
    3) Assign the page to the secure zone. 
    Hope this helps!
    -Sidney

  • How would I go about making a pong game?

    check the topic

    have two paddles that have an x and y speed and x and y coordinates and a ball that has the same thing just detect collision with the paddles and the ball and bounce it back by changing its speeds and calling xPos += xSpeed; and yPos += ySpeed; and have some sort of background image. pretty basic...

  • "System Default" kind of wipe: possible? How would one do this?

    Would it be possible to take an existing installation and effectively reinstall all packages, restore all configuration files to their default config as if on a new install on that program, and wipe all user data (probably not in that order) so as to restore a system to a kind of "first boot" setting but with your current package listing retained.
    How would one go about this? Could one slip into a terminal, sudo rm -r /some/folders/here (what folders necessary?) and then use pacman to reinstall ... everything (what kind of command would get you that? something with a grep listing?)

    karol wrote:
    r3bel wrote:
    karol wrote:
    Unless you use a ton of system-wide configs ;P
    The problem of using a backup or hard drive image of your pristine installation is that Arch changes pretty fast and a 6-month-old installation would need a bit of work to get up to speed.
    Correct me if I'm wrong but wouldnt a pacman -Syu do most of the job?
    Depends on what changed in Arch in the meantime, what changes you made and what do you mean by 'most of the job'.
    Let's say you've made your backup a couple months ago and now you want to move from grub-legacy to syslinux, install KDE and try systemd. If you revert to said backup in a month, you will have to do a few important changes "manually" because at the time of that backup you were using grub, initscripts and e.g. Gnome.
    Reverting to the "clean slate" backup, updating it and making a fresh backup once you've tested the new configuration shouldn't be much of a problem but it's not automatic. You may need to perform some manual conflict resolution etc. (see the home page).
    This is exactly why I wanted to strip the system clean and let the programs act as if this were a new install, without changing my partition table, have to download 12 gigs of data, etc. Reinstall the system without a format. Some of these changes that needed manual adjustment have caused a bit of a headache, it would be nice to have a nuclear option without having to reinstall. Especially now that AIF isn't around anymore I'd have to have a second computer to tell me what commands to run just to get things going again...

  • How would I go about....

    How would I go about making the drop down menus at the top of the program.. like "File" and "Edit" and "View" in the top bar.. or is it even possible...?

    Yes of course it's possible.
    http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html

  • Can anyone offer some advice i am looking to upgrade the OS system on one of my macbook pro's, currently running os10.4.11, I would like to upgrade to OS10.5? how would I go about this, and is there a cost, for what is an old operating system now?

    Can anyone offer some advice i am looking to upgrade the OS system on one of my macbook pro's, currently running os10.4.11, I would like to upgrade to OS10.5? how would I go about this, and is there a cost, for what is an old operating system now?

    Since your Mac probably came with 10.4, there is no longer a way to get 10.5 Leopard install media. IF it has the requirements, you may be able to upgrade to 10.6 Snow Leopard by buying the boxed install media at the Apple Store for $30.
    System requirements are found here: http://support.apple.com/kb/SP575
    General support can be found here: http://www.apple.com/support/snowleopard/

  • HT1338 I'm trying to upgrade to the OS X lion, and it says I need to have a Intel Core 2 duo. I currently have a 2 GHz Intel Core Duo. How do I go about making the change? Any help would be appreciated, Thanks Kevin

    I'm trying to upgrade to the OS X lion, and it says I need to have a Intel Core 2 duo. I currently have a 2 GHz Intel Core duo. How do I go about making the change? Any help would be appreciated. Thanks, Kevin

    I was afraid of that.... Thanks for helping!

  • HT2470 how would i go about taking multiple files from documents and make them part of 1 master file

    how would i go about taking multiple files from documents and make them into 1 master file? I want to put all documents associated with this project together for easier access.

    From the finder window, click File, click new folder, you can drag all documents into that Folder making it the master folder. You can ajso drag folders into the Master folder, and have them as sub-folders if you wish to  do that. Either way they will all be in one master folder.

  • How would I go about adding multiple rectangles using the same lines of code?

    How would I go about adding multiple rectangles using the same lines of code? I would prefer to just run through a set of code every time I need a polygon. If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.

    >>How would I go about adding multiple rectangles using the same lines of code?
    You could create a method that creates and returns x number of Rectangle elements:
    public IEnumerable<Rectangle> CreateRectangles(int numberOfRectsToCreate)
    for (int i = 0; i < numberOfRectsToCreate; ++i)
    Rectangle rect = new Rectangle();
    rect.Fill = Brushes.Blue;
    rect.Width = 100;
    rect.Height = 100;
    yield return rect;
    ..and then call this method from anywhere in your code:
    IEnumerable<Rectangle> rects = CreateRectangles(5);
    foreach (Rectangle rect in rects)
    //add to StackPanel or do whatever with the Rectangle elements:
    yourStackPanel.Children.Add(rect);
    >>If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.
    When adding Point objects to a Polygon you can only add one per call to the Add method but you could call the Add method inside a loop, e.g:
    for(int i = 0; i < 10; ++i)
    //add to StackPanel or do whatever with the Rectangle elements:
    Polygon p = new Polygon();
    p.Points.Add(new Point());
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't post several questions in the same thread.

Maybe you are looking for

  • Can't seem to restore my nano after intializing on a PC

    OK, hopefully this is an easy fix. I intially hooked the nano up to my work PC, but would, in retrospect, like to work with it on my home Cube Mac. I have tried to "restore" it so that it will work on the Mac, but when I open the iPod sofware updater

  • Oracle BI Answers Problem Using Group By condition.

    Hi All, I'm new to Oracle BI. i have a requirment to count the number of opened request and number of closed request(month wise) from a table which have fallowing columns: Date logged(Date) Status(character) Date closed(date) 8/12/2008 open null 8/19

  • Aggregate in ODI - Part 2

    Not sure why I am not getting how to aggregate in ODI! I have been trying to come up with a way to produce these results in ODI for 2 weeks now, and I am missing something. I don't believe this should be that difficult. This is the sql code I am usin

  • CProjects 4.0 - Status Report

    Hi all, I have activated the following forms for a project type: <b>DPR_STATUS_REPORT_HTML DPR_STATUS_REPORT_PDF DPR_FORM_STATUS_REPORT</b> Also I have Checked the Status Reports checkbox in the Project type because of which I can see the Status repo

  • SQL 2012 AG - Single User Mode Alternative

    We have a very busy DB in a SQL cluster at the moment, that I am moving to a 2012 AG. Every night, there is a job that moves data around into a bunch of newly created tables. In the cluster, the job uses single user mode to pause incoming data while