I assume you are requesting the MXML with ?accessible=true or you’ve enabled accessibility in flex-config?  I haven’t played with accessibility at all, not really sure what else would be wrong.

 

Matt

 


From: Doodi, Hari - BLS CTR [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 09, 2005 11:19 AM
To: '[email protected]'
Subject: RE: [flexcoders] need help about _accProps

 

Thanks, code compiles successfully but execution is wrong. Did any one try this code from actionscript language reference - key board access to flex controls?

When I run mxml, I got alert from myOnKeyDown( ) eventhough no key is pressed (except F12). When I press Ctrl+7 nothing happened. It suppose to give alert from myOnPress( ).

//*** .as file ***//

// ActionScript Document

 

function initApp()

{

            var tempButton = my_btn;

            tempButton._accProps ="Ctrl+7";

            Accessibility.updateProperties();

            var myListener:Object = new Object();

            Key.addListener(myListener);

            myListener.>

            tempButton.>

           

           

}

 

function myOnKeyDown()

{

            // 55 is key code for 7

            mx.controls.Alert.show(String(Key.getCode()),"myOnKeyDown");

            if(Key.isDown(Key.CONTROL) && Key.getCode() == 55)

            {

                        Selection.setFocus(my_btn);

                        my_btn.onPress();

                        //myOnPress()

            }

}

function myOnPress()

{

            mx.controls.Alert.show("hello","myOnPress");

}

Thanks!
Hari

-----Original Message-----
From: Matt Chotin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 09, 2005 4:25 AM
To: [email protected]
Subject: RE: [flexcoders] need help about _accProps

 

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 _accProps on 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

 



Reply via email to