MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 349

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

The remaining three sections of code each create a new Button component instance on
the Stage, reposition the instance, and add an event listener for the
button adds an event listener for the
handler function directly. The second button adds an event listener for the
and passes a reference to a listener object, which contains a handler for the
Finally, the third function adds an event listener for the
class to dispatch the click event in the
a reference to the
4.
Select Control > Test Movie to test the Flash document.
5.
Click each button instance on the Stage to see which scope in which the event is handled.
a.
Click the first button on the Stage to trace the following text in the Output panel:
[click] event on _level0.one_button instance.
this -> _level0.one_button
When you click
itself.
b.
Click the second button on the Stage to trace the following text in the Output panel:
[click] event on _level0.two_button instance.
this -> [object Object]
When you click the
buttonListener
c.
Click the third button on the Stage to trace the following text in the Output panel:
[click] event on _level0.three_button instance.
this -> _level0
When you click the
you specify in the
click
this
handler function.
click
instance, the
one_button
instance, the
two_button
object.
three_button
Delegate.create()
event and passes a reference to a
click
scope (where
this
scope refers to the button instance
this
scope refers to the
this
instance, the
scope refers to the scope that
this
method call, or in this case,
event. The first
click
click
event
click
event.
click
event, uses the Delegate
equals
) and passes
_level0
.
_level0
Using the Delegate class
349

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents