| Getting Started - Simple Math and Movieclip Properties |
|
|
|
| Written by Smash |
| Thursday, 16 July 2009 13:37 |
How do we use math in ActionScript 3.0?Using math in ActionScript 3.0 is pretty painless. I would suggest watching the video at the buttom of this page first for a better understanding of the text You can add use mathimatical equations on 2 variables like this, placing them in a 3rd variable
If you need to use multiplication/division along with addition/subtraction in the same equation, you need to use parenthasis to encapsulate what you need done first, like this If you didnt use parenthasis, then numC would get multiplied first, then numB would be added to the result. As you saw in the video we can manipulate Movie Clips in ActionScript by changing their properties. If our Movieclips instance name is myMovieClip, we could manipulate myMovieClip in a number of ways like this |



