A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: O.k. this math stuff is important but ahh...

  1. #1
    Senior member? I'm 14!
    Join Date
    May 2001
    Location
    Why you want to know you stalker!
    Posts
    316
    Sine,cosine,and complicated angles? Oh and lets not forget High School. Ya, um I'm kinda in 7th grade. So I don't really know much about this math stuff. I'm trying hard to comprehend these other things too. So I'm sorry if I have some stupid questions. Although through this troubling stage I have learned many things. I have some games made up and cool effects so I will be able to help a lot more now. So to start out here is the begining of some sample code for moving an object around the stage:

    onClipEvent (keyDown) {
    if (Key.getCode()==37) {
    setProperty (this, _x, this._x - 10);
    }
    }

    If this where assigned to a MC and you pressed the left arrow key was pressed it would move over ten pixels on the screen.

    The part in the code where it says this._x - 10);
    The this._x means the MC that you are putting the code on is being assinged a _x position on the stage. The X position is the area on the stage going across the stage from the center of the MC. The Y position is the area going vertically above and below the center of the MC. So when it says - 10 that means it will move the MC 10 pixel over on the stage to the left. Here is a diagram of the Y, X directions.
    Y
    |
    |
    Center of MC|
    -X---------|---------X
    |
    |
    |
    |
    -Y
    Hope I helped!

  2. #2
    Senior member? I'm 14!
    Join Date
    May 2001
    Location
    Why you want to know you stalker!
    Posts
    316

    Arrow Sorry

    That diagram thing got screwed up because everthjing went over to the side. It's supposed to make a plus like figuare. So don't go by it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center