Hiểu biết về phương pháp tổ chức sự kiện handler Mặc dù chúng tôi đã thảo luận một số sự kiện như vậy, đến nay, chúng tôi đã thực sự chỉ bị trầy xước bề mặt của các phản ứng Flash. Bạn đã biết rằng kịch bản phản ứng với tất cả các loại gây ra: sự tương tác với con chuột, của thời gian đạt đến một khung cụ thể | Understanding Event Handler Methods Although we ve discussed a number of events thus far we ve really just scratched the surface of Flash reactions. You already know that scripts react to all kinds of triggers interaction with the mouse the timeline s reaching a specific frame movie clip instances entering a scene. But did you know that by using event handler methods you can make your scripts execute when sounds finish playing when the stage is resized or when the text in a text field changes You can even use event handler methods to extend the functionality of the events we ve already used in this lesson. Although event handler methods and standard event handlers are used for the same basic purpose that is executing a script when something happens in your movie you must implement them a bit differently. By now you know how to set up a script to be executed as the result of an event. For example this script is attached to a movie clip instance named myMovieClip_mc and is executed whenever the mouse button is pressed while the instance is present in the scene onClipEvent mouseDown 45 This script will rotate the movie clip instance by 45 degrees when the mouse button is pressed. Using an event handler method the following script would be placed on a frame of the timeline to accomplish the same purpose rotating myMovieClip_mc whenever the mouse button is pressed function 45 Instead of using onClipEvent to define the event handler as shown in the first script here we use a dot . to separate the name of the object in this case myMovieClip_mc from the event to which it needs to react. And to reiterate we ve placed this script on a frame rather than attached it to the instance. Don t worry about the use of function in the script. We ll provide an in-depth discussion of functions in Lesson 5 Using Functions. All you need to know about this use of function is that it s a necessary part of the syntax for implementing .