Chúng tôi xác định một ranh giới contend với ranh giới mỗi ngày. Mặc dù ranh giới có thể mất nhiều hình thức, thể chất, tài chính, tâm thần, cuối cùng họ không có gì hơn một dấu hiệu của một giới hạn | 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 leftOfRoad turnWheel right else if rightOfRoad turnWheel left To make a boundary work in Flash you must define its limits and use an if statement to check the affected element each time an event occurs that might cause the element to exceed its defined boundaries. This concept will become clearer as we progress through the following exercise. For example boundaries in Flash might be used to do the following Prevent the properties of movie clip instances including x y alpha xscale yscale and so on from being changed beyond specified amounts Invoke an action property change or method when an element is within or exceeds a specified boundary Prevent data values from exceeding defined limits useful when validating data In the following exercise we ll dynamically animate the red bars at the top of the project to represent a moving launch window through which the rocket must pass to complete a successful launch. 1. Open . We ll continue building on the file you worked with in the preceding exercise. 2. With the Actions panel open select Frame 1 of the Actions layer and add this script at the end of the current script 3. 4. var direction String 5. 6. function launchWinMove 7. 8. if 0 9. 10. direction right 11. 12. else if 550