Array, Split numers in half

Sorry for the dumb question :slight_smile:

I have an old style digital clock with numbers made up of 7 part pictures.
What I want to know is like if I had a number like 42, how I would split it into a 4 and a 2, so like 4 = tens and 2 = units.
Also my Arrays are the numbers with the 7 parts switched on or off and I cant seem to get the last bit code right.
I sure don’t want to type all the code manually for all the seconds that pass in one day lol … so a shorter version would be so great.

Hope you can help :slight_smile:

Thanks in advance … :bounce:

[AS]
import flash.utils.Timer;
import flash.text.TextField;
stop();
var array0:Array = [“true”, “true”, “true”, “true”, “true”, “true”, “false”];
var array1:Array = [“false”, “true”, “true”, “false”, “false”, “false”, “false”];
var array2:Array = [“true”, “true”, “false”, “true”, “true”, “false”, “true”];
var array3:Array = [“true”, “true”, “true”, “true”, “false”, “false”, “true”];
var array4:Array = [“false”, “true”, “true”, “false”, “false”, “true”, “true”];
var array5:Array = [“true”, “false”, “true”, “true”, “false”, “true”, “true”];
var array6:Array = [“true”, “false”, “true”, “true”, “true”, “true”, “true”];
var array7:Array = [“true”, “true”, “true”, “false”, “false”, “false”, “false”];
var array8:Array = [“true”, “true”, “true”, “true”, “true”, “true”, “true”];
var array9:Array = [“true”, “true”, “true”, “true”, “false”, “true”, “true”];
var myDate:Date;
var mytimer:Timer=new Timer(1000);
mytimer.addEventListener(TimerEvent.TIMER, onTimer);
mytimer.start();
function onTimer(e:TimerEvent):void {
myDate = new Date();
var my_sec = myDate.seconds;
var my_min = myDate.minutes;
var my_hour = myDate.hours;
my_time.text = my_sec;
if ((my_sec) % 2)(dots.visible = true);
else (dots.visible = false);
if (my_sec < 10) {
B1.visible = true; //this part aint working
B2.visible = true;
B3.visible = true;
B4.visible = true;
B5.visible = true;
B6.visible = true;
B7.visible = false;
} else {
B(my_sec).visible = my_array[(my_sec)];
B2.visible = true;
B3.visible = true;
B4.visible = false;
B5.visible = false;
B6.visible = false;
B7.visible = false;
}
}
[/AS]