Skip to content

Instantly share code, notes, and snippets.

View itsDanOades's full-sized avatar

Daniel Oades itsDanOades

View GitHub Profile
@itsDanOades
itsDanOades / gist:103b38e42fcb4cb1bc46
Created July 2, 2014 16:45
Using ExternalInterface to send screen reader alerts
ActionScript:
import flash.external.*;
public class MyButton extends Sprite()
{
//Override the visible property to inform the screen reader when this object becomes visible
override public function set visible(value : Boolean) : void
{
super.visible = value;
@itsDanOades
itsDanOades / gist:fe787a163d824242af94
Last active August 29, 2015 14:03
Updating a screen reader from Flash
if(Accessibility.active)
{
Accessibility.updateProperties();
}
Note that the Accessibility.active value is set to true when any type
of assistive technology is connected and shouldn’t be relied upon to
determine if a screen reader is actually running.
@itsDanOades
itsDanOades / gist:79aa2ba5274511a5d801
Created July 2, 2014 16:41
Setting Accessibility Properties on a Flash Sprite
var myDisplayObject : Sprite = new Sprite();
//Inform the screen reader that the Sprite will serve as a button
myDisplayObject.buttonMode = true;
var accessibilityProperities = new AccessibilityProperties();
//The descriptive name to be read aloud by the screen reader or rendered in braille
accessibilityProperities.name = “My button”;
@itsDanOades
itsDanOades / gist:f0e11196e01f6bc340ab
Created July 2, 2014 16:37
Using an External Interface callback to control tabbing
//JavaScript code
//Create a HTML anchor point beforeFlash
var beforeFlash = $('<div id="beforeFlash"><a href="http://www.bbc.co.uk">Link 1</a></div>');
//Add focus listener to beforeFlash to manually override tab controls when using tabs through page
beforeFlash.keydown(function (event) {
//Override tab controls to manually pass focus to Flash
var keyCode = event.keyCode || event.which;
@itsDanOades
itsDanOades / gist:a0fe5434b7cf5b52f33c
Created July 2, 2014 16:34
Basic tab controls on a Flash Sprite
//Basic tab controls on a Flash Sprite
var myDisplayObject : Sprite = new Sprite();
myDisplayObject.tabEnabled = true;
myDisplayObject.tabIndex = 0;
myDisplayObject.buttonMode = true;