How do i move a sprite across the stage using the arrow keys on my keyboard?

I'm a high school student and i love director. I recently have become interested in game development, and i am completely lost in how to move a sprite across the stage. I have tried toying around and google hasn't been very helpful. An example of something i found is
on keyUp
  if (_key.keyCode = 124) then sprite(4).locH = sprite(2).locH -25
  if (_key.keyCode = 123) then sprite(4).locH = sprite(2).locH -25
end keyUp
I don't understand why this wont work.
HELP

This code moves sprite 2 to a position relative to sprite 4. If sprite 4 is not moving, then sprite 2 will always move to the same position, so it will not appear to move at all.
Perhaps this code makes more sense:
on keyUp
  if (_key.keyCode = 124) then sprite(2).locH = sprite(2).locH +25
  if (_key.keyCode = 123) then sprite(2).locH = sprite(2).locH -25
end keyUp

Similar Messages

  • If I have many tabs open how do I move from one tab to another using the keyboard? For example to move from one window to another we have to hit alt+tab keys. How does it work for Tabs?

    Thanks

    Hi,
    To move to the next tab it's '''Ctrl''' + '''Tab''' or '''Ctrl''' + '''Pg Dn''' (Page Down). To go to the previous tabs (reverse order) it's '''Ctrl''' + '''Shift''' + '''Tab''' or '''Ctrl''' + '''Pg Up''' (Page Up) keys. More about this and other keyboard shortcuts [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts here.]

  • How do I move pictures off my phone without losing the pictures permanently?  Is there a way to keep the pictures in the cloud without them being on my device?

    How do I move pictures off my phone without losing the pictures permanently?  Is there a way to keep the pictures in the cloud without them being on my actual phone?  I'm concerned that the sync feature will remove the pictures from the cloud when they are deleted from my phone.
    Thanks for the help.

    Can I back up iPhoto to the cloud via some apple service (iCloud)
    No
    or do I need to use something else?  If so, any recommendations?
    An external hard disk:
    Most Simple Back Up:
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex: Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store

  • How do I move booksmark to another machine without replacing the bookmarks on the new machine, i.e combine a number of bookmark files

    I'm setting up a laptop and want to have all the bookmarks from my desk machine to be moved there from different accounts, but in end up in one file so that I don't have to have loads of separate accounts.

    You need to combine all the links to one HTML file.
    You only need a file with Anchor links like this:
    <pre><nowiki>
    <a href="https://support.mozilla.com/en-US/questions/754997">How do I move booksmark to another machine without replacing the bookmarks on the new machine, i.e combine a number of bookmark files | Firefox Support Forum | Firefox Support</a></nowiki></pre>
    If you export bookmarks to an HTML file then you create a copy of your bookmarks and you edit that copy and you do not affect the original bookmarks.
    See also [/questions/737050]

  • This is my first mac i have 2 hard drives installed how do i move photos or documents from one to the other

    i just bought my first imac i have 2 seperate drives on it. how do i move photos and documents from one to the other.

    This is our resident iPhoto guru, Terence Devlin's, advice:
    You can move your iPhoto Library to an external or secondary internal disk:
    1. Quit iPhoto
    2. Copy the iPhoto Library Folder as an entity from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.

  • How do I move my files from my PC to the Cloud?

    How do I move my files from my PC to the cloud?

    i use a Photo Sync... Buy at AppStore... $2.99 only 
    Very easy to transfer photo from iPhone to Pc or from Pc to iPhone. That awesome!

  • How do I move a photo into an album in the new Photos application?

    How do I move a photo into an album in the new Photos application?

    The simplest way is to show the Sidebar at all times - you can reveal it with options-command-S  ⌥⌘S.
    With the sidebar visible, you can simply drag the photos from the Moments or other albums to the album in the sidebar. You can select and drag multiple photos at a time by selecting the first photo, holding down the shift key and selecting more photos.  If the album does not yet exist, select the photos and press ⌘N for "File > New album" to create a new album with the selected photos.

  • How do I move from one website to another using Safari, while still allowing Pandora to provide music in the background? It seems that when ever I open a new URL, I lose Pandora.

    How do I move from one website to another using Safari, while still allowing Pandora to provide music in the background? It seems that when ever I open a new URL, I lose Pandora.

    Try running Pandora in its own tab and leaving that tab open (Safari 7.1.5, OS 10.9.5).  I don't have Pandora to try this, but it works for me otherwise.
    Good luck
    srb

  • How can I move a calendar from my mac to the i Cloud

    how can I move a calendar from my mac to the i Cloud.  It is an existing calendar that I publish for others to view.  It does not update through the cloud since it is not curently on the cloud.  I cannot figure out how to move it on to the cloud.

    Your signature says you have Leopard 10.5.8 - is this correct? (If it isn't please amend it). Leopard cannot access iCloud: Lion 10.7.2 is required. Have you actually opened an iCloud account (or migrated from MobileMe)?
    if you do have Lion and have joined iCloud then your calendars should have been migrated to iCloud automatically. If this hasn't happened then the method for moving them is described in the first set of numbered instructions on this page - I emphasize that this is only possible on Lion.

  • How do I move cards in a solitaire game on the ipad

    How do I move cards in a solitaire game on the ipad?

    lawrencefromcheshire wrote:
    How do I move cards in a solitaire game on the ipad?
    Touch card, drag/move to desired position.
    Stedman

  • I have already assigned photos from iPhoto to folders in Pictures on the Mac using the instructions from Adobe. How do i now move more recent photos from iPhoto without duplication and import into Lightroom?

    I have already assigned photos from iPhoto to folders in Pictures on the Mac using the instructions from Adobe. How do i now move more recent photos from iPhoto without duplication and import into Lightroom?

    If the images are in the location you want them be sure to select "Add" at the top of the import dialog box.

  • How do i move apps that i am npt using to the card for storage and will this free up memory and space on my ipad II

    I have an Ipad II and I have a storage disc inserted on it.  I have numerous apps but am not using many of them at this time. 
    1. How do I move those I want to store on the disc to the disc and
    2. If I do, will it free up memory and/or space on my device?
    3.  And lastly, how would I move them back if needed?  I really need to free up some space.

    Use computer iTunes to sync what you need onto your iPad.

  • Can I access English movies and TV, living in Germany using the Apple TV

    Can I access English movies and TV, living in Germany using the Apple TV or maybe something else?
    I live since short in Germany and would like to have access to English TV and English movies using my internet connection. Looking at for example the Apple Store your store connection is based on your IP {address and this lands me in the German store where movies are not available in original language (or so it seems, if you do not know this the Germans change the soundtracks of all foreign movies to German by dubbing).
    Does anybody know how I would be able to watch either UK or USA TV over the internet (preferable on my TV)?
    I say thank you and yes in case you did not guess, I am new to the topic of TV over internet.

    thanks Jolly Giant
    however, there are somewhat limited options such as [_*Kabel Digital*_|http://www.kabeldeutschland.de/fernsehen/kabel-digital-international/englisch.ht ml].
    I looked in to that and they are non of the channels I want to see. Most of it is stuff you catch free to air.
    additionally, many movies, tv shows and sport broadcasts on [_*Sky Deutschland*_|http://www.sky.de/web/cms/de/abonnieren-senderinfos.jsp] come in [Zweikanalton|http://en.wikipedia.org/wiki/Zweikanalton].
    I talked to the Sky folk in Germany a while ago, and sorry to say they are as knowledgeable as the Sky UK people. In other words nobody could guarantee me anything or commit to it beingavailable in English. The most committed answer I got was that it depends on many things and one would have to look at each broadcast to see if it is also available in English.
    Hence my search continues.

  • When I create a New Folder (on the desktop or in Finder), the system uses the Generic Document Icon instead of the Generic Folder Icon. How can I change this back?

    When I create a New Folder (on the desktop or in Finder), the system uses the Generic Document Icon instead of the Generic Folder Icon. How can I change this back?
    All of a sudden I noticed that most of the folders on my computer were no longer using the folder icon, but the generic document icon. I had to manually change back the icon being used by opening Get Info for each folder and copying and pasting the generic folder icon from some folders that remained unchanged. Now whenever I create a New Folder (right click -> "New Folder"), the icon that shows up is the generic document icon (white page with top right corner turned down). And I have to manually change it so it shows up as a folder in Finder or on my desktop. I don't know why or how this switch happened. All of the folders now on my computer look ok, but I need to change the default so when I create a New Folder it uses the correct icon.
    I have also Forced Relaunch of my Finder and rebooted the system. I downloaded Candybar but am not sure what will fix anything, so I haven't proceeded.
    Anyone know how I can do this? Thanks.

    Anyone?

  • How can I set up an older airport express using the newest airport utilities?

    How can I set up an older airport express using the newest airport utilities? Seems like there isn't an option to set this up.  Normally you could add/set up this in the airport setup assistant- but that doesn't exsist any longer.
    Thanks for any suggestions 

    How can I set up an older airport express using the newest airport utilities?
    Unfortunately you can't, since Apple dropped support of the older AirPorts with AirPort Utility 6.x.
    Using some workarounds....not supported by Apple.....you might be able to download and install an older version of AirPort Utility that would allow you to administer the older AirPort.
    See this thread for more details and instructions:
    https://discussions.apple.com/message/21397085#21397085

Maybe you are looking for