Character in the Center of Screen

Hi guys please help again :angel::confused:
I am making a android platform game in flash actionscript 3. It is a side scrolling runner game.
So what I want is to make my character be on the center of the screen all the time. When it runs the character will always be at the center of the stage/screen. When I press the run button my character runs to the right then the background scrolls to the left.
Please help guys, I am still new in this actionscript 3 programming. I can't find any tutorials in the net on actionscript 3 T_T.

OMG so giving the character some actionscript motion is wrong??
Please help me sir i am very new to actionscript programming sir, I can't figure it out
Do you mind to see my codes. I have two buttons for my character, Jump button and Move button that moves only ti the right..
var dy:Number = 0;
var gravity:Number = 1;
var canjump:Boolean = false;
hero.gotoAndStop('still');
hero.speed = 0;
hero.upval = 0;
right_btn.addEventListener(MouseEvent.MOUSE_DOWN, doRight);
jump_btn.addEventListener(MouseEvent.MOUSE_DOWN, doUp);
stage.addEventListener(MouseEvent.MOUSE_UP, doStill);
stage.addEventListener(Event.ENTER_FRAME,onenter);
function doRight(e:Event):void {
        hero.speed = 5;
        hero.scaleX = -1;
        hero.gotoAndStop('walking');
function doUp(e:Event):void{
        hero.upval = -20;
function doStill(e:Event):void {
        hero.upval = 0;
        hero.speed = 0;
        hero.gotoAndStop('still');
function onenter(e:Event):void {
        hero.x +=  hero.speed;
        dy +=  gravity;
        if (hero.y > 441.95) {
                dy = 0;
                canjump = true;
        if (canjump) {
                dy = hero.upval;
                canjump = false;
        hero.y +=  dy;

Similar Messages

  • T400-a stuck pixel in the center of screen

    I just got my T400 2 days ago, now I find a stuck pixel (it's blue) in the center of screen.
    Please tell me if I can get a replacement from lenovo. Thank you!
    Solved!
    Go to Solution.

    Hello,
    the official statement is shown here as pixel policy.
    However there are some software tools, some of them seem to work. Please take a look here.
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • My imac m5521 has a ? in the center of screen how do i get past this to make my computer function?

    my imac m5521 has a ? in the center of the screen when its turned on. how can i get past it & make my computer function?

    In addition to what Niel says, consider that your hard drive may have failed.  Hopefully you have a backup.

  • Move the frame to the center of screen

    Dear,
    Could you please let me know how to move the frame to center of screen even the resolution is 640 x 480, 800 x 600 or 1024 x 768?
    Thanks,
    Man

    Here's an example I made:
    It's pretty self explaining, if it isn't ask me :)
    import java.awt.*;
    class Main extends Frame
         Main()
    setSize(200,200);
    setVisible(true);
         public void paint(Graphics g)
              Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
              int x = (int) (d.getWidth() / 2 - getWidth() / 2);
              int y = (int) (d.getHeight() / 2 - getHeight() / 2);
              setLocation(x,y);
         public static void main(String[] arg)
         {new Main();}

  • Will green line down the center of screen get worse?

    Thin vertical green line just appeared down the center of my macbook pro. of course my apple care protection plan just expired two months ago.
    Does anyone know the cause of this type of line? And if i do nothing will it get worse?

    This is a problem with the screen. Eventually more lines will appear but that is because of those lines failing or one pixel on the line being stuck. It is like not something you caused and can only be fixed by replacement of the screen. You may perhaps try calling apple and seeing what they can do about it for you since applecare was so recent.

  • Aperture 3 screen view. I have the adjustments, etc. on the left side and the picture on the far right side. The middle of screen is black. I need to get the picture back in the center of screen

    I have the adjustments, etc. on the left side of the screen. The picture is on the far right side of the screen. The middle of the screen is all black.How do I get the picture back in the middle of the acreen.  I believe I must have hit a button that moved the picture to the far right.

    On the Mac......
    Open up Macintosh HD > Applicatons > Utilities > AirPort Utility
    Click on the Time Capsule icon, then click Edit in the small window that appears
    Click the Network tab at the top of the next window
    Change the setting for Router Mode from the current DHCP and NAT to read Off (Bridge Mode), then click Update at the lower right of the window, and wait a full minute for the Time Capsule to restart to a green light.
    Then.....very important
    Power off the Time Capsule and your Arris modem/router for a few minutes
    Start up the Arris first, and let it run a few minutes by itself
    Start up the Time Capsule next the same way
    Your network will now be correct, and your printing capabilities will improve.
    If Time Machine backups do not occur now, post back and we will tackle that next.

  • 3 oval "halos" in the center of screen

    Not the best pictures in the world (iphone), but I think you can make them out. The two on the sides are vertical, and the top one is horizontal - shapes are akin to a track (ie track and field). Very light, white halo. Anyone ever seen something like this before? To the Genius [have AppleCare] I should go? Thanks in advance.
    http://images17.fotki.com/v297/photos/4/48510/325829/photo-vi.jpg
    http://images49.fotki.com/v1520/photos/4/48510/325829/photo-vi.jpg

    Thanks, BSteely. I just mentioned the logo as a way of describing the location of the "blemish" — it's definitely a physical defect and it just appeared in the last week or two. A screen shot of the area doesn't capture it. I've taken a few pictures which look very much like Andy's. They almost look like a ring stain left by the bottom of a cup on a table.
    I haven't had anything heavy resting on it, dropped it, or exposed it to extremes of temperature. I work from home, so it sits on my desk all day, pretty much every day.
    Here's some photos of my MBP's screen (You can see the half-circle blemish in the middle of the screen):
    http://dl.dropbox.com/u/236524/DSCF0003.JPG
    http://dl.dropbox.com/u/236524/DSCF0006.JPG
    http://dl.dropbox.com/u/236524/DSCF0007.JPG

  • Pink vertical line in the center of screen on Qosmio G series

    Appears to be LCD hardware problem as line is not there if external monitor used. This is the second LCD for this unit that is 2.5 years old, and in which the heat sink problem inherent in the original design of this PC has supposedly been fixed. Speakers are now starting to produce feedback if volume turned to half or more, probably due to earlier heat sink problem. In any event, Toshiba's position is they've fixed it twice for "free", and my position is a 2.5-year old $3,800 laptop should not have had to be fixed at all, yet.
    My question is this (and I couldn't get a straight answer from the Toshiba customer support person I just talked with): How do I order a new LCD for a Qosmio G15-R from Toshiba, and how much is it going to cost? I don't want to know about repair centers, since there aren't any within a hundred miles of me, and I am not interested in sending my laptop to another techie either in this or any other state. I just want the part sent to me, as i am fully qualified to install it even though I am no longer in the business. Will somebody, preferably someone who speaks recognizable English, or German, or Spanish, or even French, provide me with a simple answer to my two simple questions. Thank you.

    Hi there,
    I am sorry that you had so bad experience with your machine, I had many probs with my tecra S4 too, but they fixed it without problems. I think it has something with the repair center to do, where you´re giving your machine for repair.
    My machine was in 3 (!!) service centers and only the last two were able to fix my problem. (They were two separate probs, one of them was my fault -> chianti on my keyboard :( )
    So, if you need a new panel then you must not place your order to toshiba. You can also order a new or used panel in some spare parts onlineshops.
    I don´t know if you already looked, it seems you didn´t, otherwise you won´t write here.
    It would be interesting which machine you exactly have, maybe I can help you finding a new panel for an accurate price ;)
    Don´t worry mate, there are solutions for everything.
    Nice weekend

  • Please show me how to get rid of yahoo search COMPLETELY! I prefer google to search in the center search bar like I used to have even though it is on the search task bar

    After adding a program yahoo has hijacked the search bar on the center start screen. I still have google in the task bar but would like it to also search on the main search box like it used to. I have looked for hours trying to find a fix but will wait for your response before changing to google chrome, as I am fond of firefox and it's features. I have witnessed many others with the same feeling and wish for the freedom to choose their default browser away from yahoo. It is a step in reverse to not be able to change it !!!

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • Is there a command to open an application menu because on other peoples macs i saw them open a little bar in the center of there screen with 4 apps running and i have did that before but on accident and i did not know what i clicked. how do i open it?

    HELP! I WANT TO KNOW!

    Mission Control? It isn't a little bar in the center of the screen but does display the running apps. You can access it via the Control+Up arrow key combination and there are preferences for it in System Preferences.

  • My MacBookPro has a white screen with a grey file folder in the center of the screen with a white question mark blinking in it. What does this mean?  And how can I get my computer back up and running normal?

    My MacBookPro has a white screen with a grey file folder in the center of the screen with a white question mark blinking in it. What does this mean?  And how can I get my computer back up and running normal?

    Start up in Safe Mode.
    http://support.apple.com/kb/PH14204?viewlocale=en_US
    Repair Disk.
    http://support.apple.com/kb/PH5836
    Reset PRAM.
       http://support.apple.com/kb/PH14222

  • After what seems to be a normal upgrade to the new Lion OS. My computer counted down to restart and left a white screen with only a file folder in the center of the screen with a ? in it. How do I get my screen back to normal? Jim L.

    After what seems to be a normal upgrade to the new Mountain Lion OS X on my early 2008, 24" iMac. My iMac counted down to restart but did not turn all the way off. At the end of the count down the screen went white with a small file folder flashing on and off in the center of the screen. Also there is a ?, question mark in the miaale of the file folder. The screen responds to no keyboard or mouse commands. Request help.

    My computer was doing the same as yours hinikuru but now there is a change. I turned my iMac off by the button on the back and left it off for about an hour. When I just turned it on the center Apple logo was back and soon the  loading logo for the new Mountain Lion program came up. On the bottom of the logo there is a horizontal sliding bar that says the program will take 34 minutes to load. Time will tell. I have two iMacs and if this goes we'll I will install the new Mountain  Lion tomorrow. Hinikuru, I was about to follow the information in one of the side bar blocks titled "More like this" on the right side of this screen when my iMac seemed to fix itself! Good luck. I think not all is lost.

  • HT1208 After updating my iphone 5C, the screen was black but had the itune logo in the center, a white arrow pointing to the logo, and what seemed like a white lock, but it had a long white line leading to the bottom of phone.  Phone is now frozen.  What

    After adding the latest update to my 5c iphone, the screen was black, with the itune logo in the center, a white arrow below it point to the logo, and below that, what seemed to be a white lock, but it had a long white line reaching the bottom of the screen.  I can't get the phone to start.  The white apple appears and then I get the same logo, arrow, etc.  What can I do to fix this?  Thanks for any assistance.

    i m also put passcode in my iphone...but i dont know that how i know that my passcode is crack by someone???and same as police is not interested to find out it..
    i want ma iphone backkk...........

  • How do I get alerts to remain in the center of the screen after unlocking my iPhone in iOS 7?

    The whole point of alerts, according to Apple, is to let you know about important events by remaining in the center of the screen until you acknowledge them. So why, when my iPhone 4s is locked and I receive an alert, does absolutely nothing appear when I unlock my phone? I use OmniFocus2 for everything, but the app isn't useful to me without forcing me to acknowledge the alerts I've set up for my to-do's. I've messed with all the notification options (like removing from lock screen), but I simply cannot believe that the only way Apple would allow their alerts to work properly is by forcing me to keep my phone from auto-locking indefinitely.
    Can anyone help?
    Jackie

    I just came from using a BlackBerry Z10 and just got a iphone 5S. I have to say that this is the most ridiculous issue i am having to deal with as well. I use a password for my lock screen and if im not constantly on my phone i will miss a text msg. theres nothing from the lock screen to show you of a missed text or etc and also i dont care that i can look at notifications pull down. that is useless for the common person who doesn't live on the phone. There's no led to help this issue another major negative for me and this issue as well. So pretty much if i dont check my phone periodically i will miss something for sure. Cant believe this phone is considered the flagship of phones, there are SIMPLE issues with iphones that many other company's have fixed YEARS ago. Seriously would a LED light really hurt that bad to put on?! Get a clue apple!
    --sorry for the rant but i have been looking everywhere online and trying many issues to fix this with no luck.

  • How do you fix an LCD screen ripple dot in the center of the display (Macbook pro 13 inch late 2011

    There is a small dot that ripples in the center of the screen. I have an Early 2011 macbook pro 13 inch and it should not have any problems with it. Does anyone have suggestions?

    it should not have any problems with it.
    No, it shouldn't, but technology is not perfect.  Sh*t happens.

Maybe you are looking for

  • Emailing .gif?

    Hello, 1. When I drag a .gif from the Finder to a 'new mail' in Mail.app the gif does not animate. It just sits like an image. Question: How do I send animated .gif? 2. (sorry for OT) What's the best program to open .gif with? Safari does it but lags

  • How to exclude files within Packages?

    I'd like to exclude certain files (or directories) from Time Machine's backup, but these files are within a Package file. iWebSites is an application that manages multiple Domain files for iWeb. It does so by copying and moving a Domain file for each

  • Is there a way to know how many minutes left from ...

    Is there a way to know how many minutes left from your subscription from the Skype phone app?? Thanks!

  • Adding columns in a open sql select query

    Hi Everyone, I would like to add the values of n columns of a table and place them in one column, how can i achieve this in open sql. In oracle native sql the query will look like this: Select col1 + col2 + col3 AS col from tab1; On a similar grounds

  • Descriptions of BI Content does not appear in Spanish

    Hello, When you log on English, the descriptions of the BI Content appear correctly When you log on Spanish, the descriptions of the BI Content not appear only appear the technical names What can I do to display the descriptions in Spanish? Thank you