Skip to Content
Flash 8 Cookbook
book

Flash 8 Cookbook

by Joey Lott
April 2006
Beginner
544 pages
14h 51m
English
O'Reilly Media, Inc.
Content preview from Flash 8 Cookbook

9.8. Building Menus with Buttons

Problem

You want to create menus such that you can press one button and then roll over and release on others.

Solution

Set all the button instances to track as menu items.

Discussion

The normal behavior for buttons is such that if you press one button (but don’t yet release) and then drag the mouse pointer over another button, the other button will not respond to the rollover event. And if you release on top of a button other than the one on which you first pressed, the release event will not be activated either. In many cases, this is the behavior that you want from your buttons. However, when working with buttons that compose menus, you may want to alter that behavior such that buttons in the menu respond to rollover and release events even if the user first pressed another button in the menu. This behavior is particularly important for pop-up menus in which the user has to press one button to expand the menu.

You can quickly modify the behavior of a button in this way by setting it to track as a menu item. With button symbol instances, you can choose this option from the Property inspector. If you select the button instance on the stage, you can choose Track as Menu Item from the tracking menu.

The preceding technique works for button symbol instances at authoring time. If you want to track movie clip symbols as menu items or if you want to perform the same task at runtime, you can use the trackAsMenu property. The trackAsMenu property is a property ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Flash® CS4 for Dummies®

Flash® CS4 for Dummies®

Ellen Finkelstein, Gurdy Leete

Publisher Resources

ISBN: 0596102402Catalog PageErrata