Skip navigation
Adham_Dwikat
Currently Being Moderated

keyboard event dont dispatch when switch to arabic on mac

Jun 29, 2012 9:33 AM

keyboard event dont dispatch when switch to arabic on mac

 

i have faced aaproblem

iam writing simple code in flash cs5 -as3

i creat my project from windows  invironment

after publishing the code and testing  it on mac , the keyborad event didnt fired , and that happens only when switch the keyboard to arabic language.

but when the selected language is english every thing work fine

 

this my code

 

import flash.ui.Keyboard;
import flash.events.KeyboardEvent;
import fl.text.TLFTextField;
import flash.text.TextFieldType;
 
 
var trace_txt:TLFTextField= new TLFTextField()
trace_txt.width=500
trace_txt.height=400
addChild(trace_txt)
trace_txt.selectable=true;
var txt:TLFTextField= new TLFTextField()//this is only for writing text in , to test when switching to arabic lang 
txt.height=30
txt.width=500
txt.y=410
trace_txt.y=5
txt.x=5
trace_txt.x=5
txt.selectable=true
txt.type=TextFieldType.INPUT
addChild(txt)
txt.border=true
trace_txt.border=true
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler)
function keyDownHandler(e:KeyboardEvent):void
{
          try
          {
                     
          trace(e.keyCode)
          trace(String(e.keyCode))
           var character:String = String.fromCharCode(e.charCode);
          trace_txt.appendText("keycode:"+e.keyCode+",   charCode:"+character+",   keyLocation :"+e.keyLocation +"\n")
          if(e.keyCode==Keyboard.A)
          {
                    trace_txt.appendText("a is pressed\n")
          }
          }
          catch(e)
          {
                    trace_txt.appendText("errroor\n")
          }
  
}
//stage.focus=stage;
 
 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points