• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 15. Actionscript Syntax > Comparing Expressions

Comparing Expressions

Many programming decisions are made by comparing the equality of two values. Is this value the same as that value? Is one value greater than the other?

These types of comparisons are at the root of task that's not predefined. For instance, if you want a ball to bounce off the walls of a room, you could animate it by hand in the timeline, but the animation would be the same each time you ran the animation. If you want to have some variability (balls of different sizes, walls in varying positions, and so on), you must determine whether the ball has hit a wall, which you do by testing the position of the ball against the positions of the walls.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint