Button.trackasmenu - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Button.trackAsMenu

Availability
Flash Player 6.
Usage
my_btn.trackAsMenu:Boolean
Description
Property; a Boolean value that indicates whether other buttons or movie clips can receive mouse
release events. If you drag a button and then release on a second button, the
registered for the second button. This allows you to create menus. You can set the
property on any button or movie clip object. If the
the default behavior is
You can change the
on the new behavior.
Example
The following example demonstrates how to track two buttons as a menu. Place two button
instances on the Stage called
Timeline:
var one_btn:Button;
var two_btn:Button;
one_btn.trackAsMenu = true;
two_btn.trackAsMenu = true
one_btn.onRelease = function() {
trace("clicked one_btn");
};
two_btn.onRelease = function() {
trace("clicked two_btn");
};
Test the SWF file by clicking the Stage over
releasing it over
and test the SWF file again to see the difference in button behavior.
trackAsMenu
See also
MovieClip.trackAsMenu
162
Chapter 2: ActionScript Language Reference
.
false
property at any time; the modified button immediately takes
trackAsMenu
one_btn
. Then try commenting out the two lines of ActionScript that contain
two_btn
trackAsMenu
and
. Enter the following ActionScript in the
two_btn
, holding the mouse button down and
one_btn
onRelease
trackAsMenu
property has not been defined,
event is

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash mx

Table of Contents