This is a discussion on How use the short cuts for button in Flash within the Flash Actionscript Programming forums, part of the Web Development category; Hi..Guys. This is the post for creating shortcut for button and working with it. The following steps followed for ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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 Last edited by arunsamini : 10-31-2007 at 09:39 PM. |
|
#2
| |||
| |||
| Hi i used your code. its working fine may i know the use of Quote:
even though i commented these following two lines Quote:
i tested this code in Flash cs3. Quote:
__________________ SeeSamJagan- Sky is not the "LIMIT", Death is not the END, There is still something beyond.... |
|
#3
| |||
| |||
| _accProps property: Lets you control screen reader accessibilityoptions for SWF files, movie clips, buttons, dynamic text fields, and input textfields at runtime. Theseproperties override the corresponding settings available in the Accessibilitypanel during authoring. For changes to these properties to take effect,you must call Accessibility.updateProperties(). Its properties are "silent, forceSimple, name, description, shortcut". We can simply store the shortcut values to that movieclip thats all. Regards A.Ramesh |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| simple short cuts for internet explore & some other latest browser | vijayanand | The Lounge | 3 | 10-21-2007 07:34 PM |
| Microsoft cuts Vista's price in China to curtail piracy | senthilkannan | Microsoft | 0 | 08-07-2007 03:40 AM |
| Keyboard short cuts of PhotoShop CS2 | PixelNameVj | Web Design Help | 1 | 07-30-2007 09:34 AM |
| Can I make a button on my page work as the browser's Back button in javascript? | kingmaker | HTML, CSS and Javascript Coding Techniques | 1 | 07-26-2007 12:27 AM |
| COM - The Short Explanation | Karpagarajan | C and C++ Programming | 0 | 04-10-2007 08:52 AM |
Our Partners |