Alright, I came up with it earlier than I would think I can. This is to select and put in all of the information. The catch is, that I couldn’t find a way to make the buttons change different colors or anything. Really, all this script does, it just uses the array I made, and has nothing to do with the movie clips. Here is the code I have so far:
//Put this all in the current frame that will hold your buttons
var row:Number = 0;
var col:Number = 0;
var btnpad:Array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
function enterInfo(num:Number):Void {
if (Key.isDown(13)) {
if (txt+num<100) {
txt += num;
} else {
txt = "";
txt += num;
}
}
}
function switchBtns():Void {
if (Key.isDown(37)) {
col--;
} else if (Key.isDown(38)) {
row--;
} else if (Key.isDown(39)) {
col++;
} else if (Key.isDown(40)) {
row++;
}
if (row<0) {
row = 0;
}
if (row>2) {
row = 2;
}
if (col<0) {
col = 0;
}
if (col>2) {
col = 2;
}
enterInfo(btnpad[row][col]);
}
onEnterFrame = function () {
switchBtns();
};
I will try to make the part that makes the selected button and I will post it on here. Hope I helped…even more!
------------------------UPDATE-------------------------------
I have fixed it. Put in the code below in the current frame, as you did in the above script I proposed. Now have every MovieClip in your pad labeled with the instance names from “1-9” depending on the button it is(for example, for button 1, it would have the instance “1”, and so on…). Then, put in the second script I will supply you(below the one below this text), in each of the MovieClips that you have on stage. Here is the _root frame script:
var row:Number = 0;
var col:Number = 0;
var btnpad:Array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
function checkSelection(mc:MovieClip):Void {
if (mc._name == btnpad[row][col]) {
mc.gotoAndStop(2);
} else {
mc.gotoAndStop(1);
}
}
function enterInfo(num:Number):Void {
if (Key.isDown(13)) {
if (txt+num<100) {
txt += num;
} else {
txt = "";
txt += num;
}
}
}
function switchBtns():Void {
if (Key.isDown(37)) {
col--;
} else if (Key.isDown(38)) {
row--;
} else if (Key.isDown(39)) {
col++;
} else if (Key.isDown(40)) {
row++;
}
if (row<0) {
row = 0;
}
if (row>2) {
row = 2;
}
if (col<0) {
col = 0;
}
if (col>2) {
col = 2;
}
enterInfo(btnpad[row][col]);
}
onEnterFrame = function () {
switchBtns();
};
Here is the second script, to be put in each of the movieclips:
onClipEvent (enterFrame) {
_root.checkSelection(this);
}
There, I hope I helped you solve your problem. If you still have problems, I will upload my .fla for you to see. Good luck on your…remote for your TV, lol!