Hi..Guys.
This is the post for creating shortcut for button and working with it. The following steps followed for creating shortcuts....
1)create two button with name as btn1 and btn2
2)then add the following code to main timeline
//AS 2.0 coding
var keyListener:Object=new Object();
keyListener.onKeyDown=function(){
if(Key.getCode()==89)
{
Selection.setFocus(btn1);
btn1.onRelease();
}
else if(Key.getCode()==78){
Selection.setFocus(btn2);
btn2.onRelease();
}
}
Key.addListener(keyListener);
btn1._accProps.shortcut = "y";
btn2._accProps.shortcut = "n";
btn1._focusrect=false; //optional
btn2._focusrect=false; //optional
Accessibility.updateProperties();
btn1.onRelease=function(){
trace("btn1");
}
btn2.onRelease=function(){
trace("btn2");
}
3)save and run the application...
Note:
I use the key as "y" and "n" for shortcuts. If u can use ur own shortcuts by setting the Key.getCode() value.
S.Arun

Less Tension Work More