Travels

Monday, March 10, 2008

Yahoo Pipes is Awesome!

For anyone who hasn't tried Yahoo Pipes yet check it out. Pipes allows you to create custom RSS feeds. This is very cool for making complex mash-ups. For example, a friend of mine is looking for an audio position in New York City. I created a simple pipe that uses Google's Job Search and the keyword audio and out came a list of job postings that were mostly relevant. After you make a pipe you can save it to your Yahoo or Google homepage, or access it as an RSS feed, etc.

I heard about Yahoo Pipes from an installation artist who was searching news feeds for different words and then applying that data to a device that dripped paint on a canvas depending on the amount of data received. I was really impressed how easy it was for him to parse so much data down to a single feed.

After playing with Pipes, I think it may be a good solution to an experiment I've been wanting to try. The idea is to get all sorts of real-world data into Flash, use that data to make inferences based on culture and psychology and then have it influence an interactive pet's emotion engine. More simply, if I know it's been rainy and there are a lot of negative keywords in the news the pet could be sadder than usual. If it is close to a cultural, religious, federal holiday the pet could be happier. It is my hope that by creating an emotion engine fed by this data, and then creating a personality that reacts to this data in a certain way, much more realistic virtual characters and environments could be created. Best of all if I use Pipes, I can keep most of the complex parsing out of Flash and use a single feed to get all the information I need.

Thursday, March 6, 2008

Making games accessible

Recently I've been making some games I've been working on accessible to the mobility and vision impaired to satisfy 508 compliance. This usually involves setting up tabIndex attributes and adding tags that screen readers can pick up.

Here's a quick overview for adding accessibility using AS2

Adding tabIndex is easy; just write:
someObject.tabIndex = 3;
to change it simply reassign the tabIndex a new value

Adding alt tags for screenreaders requires a little bit more code;
someObject._accProps = new Object();
someObject._accProps.name = "Text for the screen reader";
Accessibility.updateProperties();

The last line updates the alt text; so if you want to change the alt text after setting it once:
someObject._accProps.name = "Next alt text";
Accessibility.updateProperties();

That's about it, not too hard but the key is to test it out. Tabbing is easy enough you can test it straight from Flash, just make sure the Control>>Disable Keyboard Shortcuts is turned off

Testing the alt tags is trickier. You'll need screenreading software. I use a demo version of Windows Eyes. JAWS has also been recommended to me.
The demo only lasts about 30 min every time you open it, so I have it in a virtual machine which I restart whenever I need without rebooting my computer.

So far I've found one bug with tabbing. If you have tabbed onto an object and then set its ._visible = false; the tabbing order (sometimes) will skip ahead of the expected next object. I did some testing and so far I've found that if you use unloadMovie instead of _visible there is no problem.

FYI if you remove an object that you are currently tabbed to, the expected result of removing it or making it's tabindex = undefined is that the next object will be the one with the lowest tabIndex (the first object in the tabbing list).

To remove tabbing from an object:
someObject.tabIndex = undefined;

To stop alt text from being read by a screen reader, either
someObject._accProps.name = "";
Accessibility.updateProperties();

or

someObject._accProps._silent = true;

Here are some techniques I use for controlling accessibility:

I make variables to act as switches for tabbing and screen reader accessibility.

The tabbing var I set to false, then if tab is pushed I switch it to true.
The screen reader var I set to false and then set to true using Accessibility.isActive();

I usually set the screen reader switch within a keypress handler or some other function that runs soon after the movie is loaded. I do this because if you check Accessibility.isActive(); first thing, you may get a false negative.


Here are some useful links for reading up on Flash accessibility:
AS2:
http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001895.html
(try the white paper below for a better list)

AS3:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/accessibility/AccessibilityProperties.html

For a good source of accessibility answers for Flash check out:
http://www.adobe.com/accessibility/

The white paper by Bob Regan is an excellent read for getting a better understanding of what accessibility means and how to make Flash accessible.