IT Community - Software Programming, Web Development and Technical Support

How use the short cuts for button in Flash

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Flash Actionscript Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 10-31-2007, 02:00 AM
arunsamini arunsamini is offline
D-Web Trainee
 
Join Date: Oct 2007
Posts: 8
arunsamini is on a distinguished road
Post How to use the short cuts for button in Flash

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-28-2007, 01:28 AM
seesamjagan seesamjagan is offline
D-Web Programmer
 
Join Date: Aug 2007
Location: Chennai
Posts: 66
seesamjagan is on a distinguished road
Send a message via AIM to seesamjagan Send a message via Yahoo to seesamjagan
Default Re: How to use the short cuts for button in Flash

Hi
i used your code. its working fine

may i know the use of
Quote:
Accessibility.updateProperties();
the above statement in the script?

even though i commented these following two lines
Quote:
//btn1._accProps.shortcut = "y";
//btn2._accProps.shortcut = "n";
its working without any problem . then what is the purpose of those two lines
i tested this code in Flash cs3.

Quote:
Originally Posted by arunsamini View Post
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
__________________
SeeSamJagan
- Sky is not the "LIMIT", Death is not the END, There is still something beyond....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-24-2008, 08:47 PM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: How use the short cuts for button in Flash

_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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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
Short Cut 2 success Sabari The Lounge 0 09-04-2007 06:51 AM
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


All times are GMT -7. The time now is 02:33 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
Miami FL Divorce Lawyers      Pittsburgh Personal Injury Law      Austin TX Auto Accident Lawyer
Sedo - Buy and Sell Domain Names and Websites project info: discussweb.com Statistics for project discussweb.com etracker® web controlling instead of log file analysis

SEO by vBSEO 3.0.0