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

Lesson 8. Using Conditional Logic > Defining a Boundary

Defining a Boundary

We contend with boundaries every day. Although boundaries can take many forms—physical, financial, mental—in the end they're nothing more than an indication of a limit. To make a boundary work, you define its limits and take appropriate action when (or just before) those limits are exceeded. Think of driving a car: lines on the road define the boundaries within which the car is supposed to remain. If you're approaching the line on the left (the left boundary), you move the steering wheel to adjust; if you're approaching the line on the right, you adjust in the opposite direction—conditional logic in action! Written in ActionScript, those actions might look like this:

if (car_mc._x < leftOfRoad) {
  turnWheel ("right");
} else if (car_mc._x > rightOfRoad) {
  turnWheel ("left");
}


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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