# Array, Split numers in half

**URL:** <https://forum.kirupa.com/t/array-split-numers-in-half/331865>\
**Category:** flash\
**Created:** [November 11, 2013, 10:27pm UTC](https://forum.kirupa.com/t/array-split-numers-in-half/331865 "2013-11-11T22:27:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottiescotsman](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@scottiescotsman](https://forum.kirupa.com/u/scottiescotsman)\
**Post date:** [November 11, 2013, 10:27pm UTC](https://forum.kirupa.com/t/array-split-numers-in-half/331865/1 "2013-11-11T22:27:41Z")

</div>

Sorry for the dumb question 🙂

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 🙂

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]
