Techniques for WCAG 2.0

Skip to Content (Press Enter)

This document is a draft, and is designed to show changes from a previous version. It is presently showing added text,changed text,deleted text,[start]/[end] markers,and Issue Numbers.

Hide All Edits   |   Toggle Deletions  |   Toggle Issue Numbers   |   Toggle [start]/[end] Markers   |   Show All Edits

Changes are displayed as follows:

-

FLASH35: Using script to scroll Flash content, and providing a mechanism to pause it

Applicability

This technique relates to:

User Agent and Assistive Technology Support Notes

See User Agent Support for Flash for general information on user agent support.

Description

Editorial Note: The wiki indicated this applies to 2.2.1 but that doesn't seem right because it's just about scrolling, removed that.

The objective of this technique is to provide a way for users to stop scrolling content when the scrolling is created by a script. Scrolling content can be difficult or impossible to read by users with low vision or with cognitive disabilities. The movement can also be distracting for some people making it difficult for them to concentrate on other parts of the Web page.

Examples

Example 1: A toggle button to pause and resume scrolling

In this example, text scrolls from left to right. A toggle button is provided that allows the user to pause and resume the scrolling behavior. Additionally, a checkbox is provided which can be used to slow down the scrolling speed.

Note: Users may prefer a greater variety of scrolling speed options than are offered in this example. Developers might choose to provide several speed choices with a slider or drop down list control in order to accomplish this.

Example Code:

import fl.accessibility.ButtonAccImpl;
import fl.accessibility.CheckBoxAccImpl;

ButtonAccImpl.enableAccessibility();
CheckBoxAccImpl.enableAccessibility();

var scrollInterval: int;
var intervalLength: int = 15;

var expandedViewer: MovieClip = exampleScroller.expandedViewer;
var scrollText: MovieClip = exampleScroller.scrollText;
var scrollViewer: MovieClip = exampleScroller.scrollViewer;

var scrollingPaused: Boolean = true;

scrollStopper.addEventListener(MouseEvent.CLICK, handleBtnClick, false);
slowDown_chk.addEventListener(MouseEvent.CLICK, handleChkClick, false);

function handleBtnClick(e) {
  toggleScroll(false);
  e.target.label = scrollingPaused? "Resume Scrolling": "Stop Scrolling";
}

//slow down scrolling speed
function handleChkClick(e) {
  intervalLength = e.target.selected? 50: 15;
  if (! scrollingPaused) {
    clearTimeout(scrollInterval);
    toggleScroll(true);
  }
}

//pause or resume scrolling
function toggleScroll(noToggle: Boolean) {
  if (noToggle || scrollingPaused)
  scrollInterval = setInterval(moveText, intervalLength); else
  clearTimeout(scrollInterval);
  if (! noToggle)
  scrollingPaused = ! scrollingPaused;
}

function moveText() {
  if (scrollText.x + scrollText.width < scrollViewer.x)
  scrollText.x = scrollViewer.x + scrollViewer.width;
  scrollText.x -= 1;
}

//initiate scrolling
toggleScroll(false);

The technique is demonstrated in the working version of A toggle button to pause and resume scrolling. The working version of A toggle button to pause and resume scrolling is available.

Tests

Procedure

When a Flash Movie contains scrolling content, confirm that a button is provided that allows users to pause and resume the scrolling behavior:

Expected Results