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

Lesson 10. Processing Data Using Middleware > Using the onClipEvent Handler

Using the onClipEvent Handler

Handlers are special actions that “handle,” or manage, events such as press or release. You have used handlers to attach ActionScript to buttons (on (press)), and you can use the onClipEvent handler to attach ActionScript to a movie clip in a similar fashion. The onClipEvent handler has a single arguement: movieEvent. When Data is specified as the MovieEvent arguement, the action contained in the onClipEvent handler is initiated when data is received in a loadVariables or loadMovie action. When it is specified with a loadVariables action, the Data event occurs only once: when the last variable is loaded. When it is specified with a loadMovie action, the Data event occurs repeatedly as each section of data is retrieved.

In the following exercise, you will assign an onClipEvent handler to the instance of the Input Clip movie clip on the stage. Then you will set the value of the handler's movieEvent to Data so that the ActionScript in the handler executes only when data is received in the movie clip. The data will be received only when the information sent to the ColdFusion file has been processed, so this code works as an error-checker to ensure that the movie doesn't proceed until the data has been processed.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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