Techniques for WCAG 2.0

Skip to Content (Press Enter)


FLASH27: Providing button labels that describe the purpose of a button


This technique relates to:

User Agent and Assistive Technology Support Notes

See User Agent Support Notes for FLASH27.


The objective of this technique is to describe the purpose of a button by providing descriptive text as the button's accessible name. The description lets a user distinguish this button from other buttons in the Flash movie and helps the user determine whether to activate the button. An empty string is not sufficient as a button's accessible name.

For buttons with text labels, the label text will be used as a buttons accessible name. If a button is image based and does not have a text label, the button's accessible name will have to be set separately using the Accessibility panel or through scripting.


Example 1: Using the label property to describe the button's purpose

Example Code:

import fl.controls.Button;
import fl.accessibility.ButtonAccImpl;


var myButton:Button = new Button();
myButton.label = "View";

Example 2: Using scripting to set the accessible name for an image button using Actionscript 3.0

In this example, the button's label property is deliberately set to an empty string. To be perceivable to assistive technology, the button's property is set.

Example Code:

import fl.controls.Button;
import fl.accessibility.ButtonAccImpl;
import flash.accessibility.*;
import flash.system.Capabilities;

var soundIsMuted = false;
var myButton:Button = new Button();
myButton.setStyle("icon", unmuted);
myButton.label = "";
myButton.x = myButton.y = 10;
myButton.width = myButton.height = 50;
updateAccName(myButton, "mute sound");
myButton.setStyle("icon", unmuted);
myButton.addEventListener(MouseEvent.CLICK, handleBtnClick);

function handleBtnClick(e) {
  soundIsMuted = !soundIsMuted;
  myButton.setStyle("icon", soundIsMuted ? muted : unmuted);
  updateAccName(myButton, soundIsMuted ? "unmute sound" : "mute sound");

function updateAccName(obj, newName:String) {
  if (!obj.accessibilityProperties)
    obj.accessibilityProperties = new AccessibilityProperties(); = newName;
  if (Capabilities.hasAccessibility)



For each button in the Flash movie that uses this technique:

  1. Check that the button's label text correctly describes the button's purpose

  2. If a button does not have a text label, confirm that descriptive text has been added as the button's accessible name.

  3. If a button contains both label text and an accessible name, confirm that the combination of the two makes sense as a description for the button's purpose.

Expected Results

If this is a sufficient technique for a success criterion, failing this test procedure does not necessarily mean that the success criterion has not been satisfied in some other way, only that this technique has not been successfully implemented and can not be used to claim conformance.

Techniques are Informative

Techniques are informative—that means they are not required. The basis for determining conformance to WCAG 2.0 is the success criteria from the WCAG 2.0 standard—not the techniques. For important information about techniques, please see the Understanding Techniques for WCAG Success Criteria section of Understanding WCAG 2.0.