Hey everyone,
I am having some problem with the following code in Internet Explorer
6.0 on Windows 2000 with Flash Player 9. I am trying to write code for a
hotkey to recognize when both the CTRL key and either X,C, or V is
pressed in order to do copying and pasting. I will attach a sample of
the code below. This code works in Firefox with Flash Player 9 just fine
and I have been told it works in Internet Explorer 7.0
I have a keyListener object set up which contains the following code.
var temp = this;
this.keyListener = new Object();
this.keyListener.onKeyDown = function()
{
temp.checkHotKeys()
}
Key.addListener(this.keyListener);
In the temp object, I have the function checkHotKeys which is as follows:
function checkHotKeys()
{
//Ctrl-X
if(Key.isDown(Key.CONTROL) && Key.isDown(88))
this.editCut();
//Ctrl-C
if(Key.isDown(Key.CONTROL) && Key.isDown(67))
this.editCopy();
//Ctrl-V
if(Key.isDown(Key.CONTROL) && Key.isDown(86))
this.editPaste();
//Delete
if(Key.isDown(Key.DELETEKEY))
this.editDelete();
}
I added some traces for Key.getCode() in the above function and found
that when I was holding down the CTRL key and then pressed another key,
Key.getCode() would still return 17, effectively not recognizning that
the second key was pressed. Alternatively, if I held down X/C/V first
and then pressed the CTRL key, it would update correctly.
Also, I replaced all instances of Key.CONTROL with Key.SPACE and it
worked correctly with space bar.
Does anyone have any idea why this would not work in IE6 and if there
are any workarounds? Has anyone even seen this error before?
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com