Hmm, I think that must be a bug that we
have the compiler error. The way you would work around it is to declare a
local variable untyped and assign it to your button, then put the _accPropson
there.
var tempButton = my_btn;
tempButton._accProps = …
You should maybe file a but at http://www.macromedia.com/go/wish and
maybe make a comment on the livedocs in the accessibility section about this.
Matt
From: Doodi, Hari -
BLS CTR [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 08, 2005 7:50
AM
To: [email protected]
Subject: [flexcoders] need help
about _accProps
Hi all, I am trying to allow my users to access screen UI component
thru
KeyBoard. In order to do that I am using _accProps
property of UI components
(according to macromedia livedocs).
Actually I got the following code from macromedia
live docs
http://livedocs.macromedia.com/flex/15/
<http://livedocs.macromedia.com/flex/15/>
But when I try to run(F12) my .mxml file I am
getting compilation error
saying "there is no property with the name
'_accProps'". Can any one tried
Key board shortcuts?
Here is the code in my .as file.
// ActionScript Document
function initApp()
{
var
myListener:Object = new Object();
Key.addListener(myListener);
myListener.>
my_btn.>
if(my_btn._accProps
== undefined)
{
my_btn._accProps = new Object();
}
my_btn._accProps.shortcut = "Ctrl+7";
Accessibility.updateProperties();
}
function myOnKeyDown()
{
// 55 is key code
for 7
if(Key.isDown(Key.CONTROL) && Key.getCode() == 55)
{
Selection.setFocus(my_btn);
my_btn.onPress();
}
}
function myOnPress()
{
mx.controls.Alert.show("hello","myOnPress");
}
Thanks in advance.
Thanks!
Hari
|