22.6. Overriding the Default Active Button State

Problem

You want to disable the yellow border that appears around the active button on the stage.

Solution

Give the button an empty Over frame or set the _focusrect property to false.

Discussion

By default, the Flash Lite player will draw a two-pixel yellow border around the active button, providing a visual cue as to which button is active. This behavior may be desirable for simple applications, but in many cases you will want to retain artistic control and design your own visual indicator for the active button. There are two ways to disable this automatic yellow border:

  1. If you wish to disable this border only for this button symbol (and all corresponding button instances), edit the button, select the Over frame, and insert a Blank Keyframe (Insert → Timeline → Blank Keyframe).

  2. If you wish to disable this border for your entire movie, enter the following ActionScript command in the Actions panel for the first frame of your movie:

    	_focusrect = false;

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.