Click here to Skip to main content
15,888,190 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to convert my code which it is in as2 to as3 im working on making on screen keyboard but i couldnt,,,, can you help?


_root.enterField = "";
//Numbers Array
numbers = new Array("0","1", "2", "3", "4", "5", "6", "7", "8", "9");
numberText = new Array("zero","one", "two", "three", "four", "five", "six", "seven", "eight", "nine");
//Set the Numbers in the text boxes, and create the onPress function for the numbers state.
for(ip=0; ip<10; ip++){
_root[numberText[ip]].keyLabel = numbers[ip];
_root[numberText[ip]].onPress = function() {
this.gotoAndPlay("down");
_root.enterField = _root.enterField+this.keyLabel;
}
}

//Backspace button delete the last text
backspace.onPress = function(){
_root.enterField = _root.enterField.slice(0, enterField.length-1);
this.gotoAndPlay(2);
}
//Space Bar
space.onPress = function(){
_root.enterField = _root.enterField+" ";
this.gotoAndPlay(2);
}
//Caps Lock
capslock.onPress = function(){
this.gotoAndPlay("off");
}
//Clear Button
clear.onPress = function(){
_root.enterField = "";
this.gotoAndPlay(2);
}
stop();
Posted
Updated 14-Nov-11 6:59am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900