Macromedia flex 2 Manuale

Pagina di 254
Adding version numbers
171
When you create a component, you can include ActionScript that enables the component and 
a screen reader for audio communication. When developers use your component to build an 
application in Flash, they use the Accessibility panel to configure each component instance.
Flash includes the following accessibility features:
Custom focus navigation
Custom keyboard shortcuts
Screen-based documents and the screen authoring environment
An Accessibility class
To enable accessibility in your component, add the following line to your component’s class 
file:
mx.accessibility.ComponentName.enableAccessibility();
For example, the following line enables accessibility for the MyButton component:
mx.accessibility.MyButton.enableAccessibility();
For additional information about accessibility, see Chapter 36, “Creating Accessible Applications,” in Flex 2 Developer’s Guide.
Adding version numbers
When releasing components, you can define a version number. This lets developers know 
whether they should upgrade, and helps with technical support issues. When you set a 
component’s version number, use the static variable 
version
, as the following example shows:
static var version:String = "1.0.0.42";
If you create many components as part of a component package, you can include the version 
number in an external file. That way, you update the version number in only one place. For 
example, the following code imports the contents of an external file that stores the version 
number in one place:
include "../myPackage/ComponentVersion.as"
The contents of the ComponentVersion.as file are identical to the previous variable 
declaration, as the following example shows:
static var version:String = "1.0.0.42";
NO
TE
Flex does not use or interpret the value of the 
version
 property.