# \[F8 - AS2.0\] interesting math problem

**URL:** <https://forum.kirupa.com/t/f8-as2-0-interesting-math-problem/218564>\
**Category:** flash\
**Created:** [March 8, 2007, 8:58pm UTC](https://forum.kirupa.com/t/f8-as2-0-interesting-math-problem/218564 "2007-03-08T20:58:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dom\_1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dom\_1](https://forum.kirupa.com/u/Dom_1)\
**Post date:** [March 8, 2007, 8:58pm UTC](https://forum.kirupa.com/t/f8-as2-0-interesting-math-problem/218564/1 "2007-03-08T20:58:47Z")

</div>

Hey people,  
I have a pretty dumb problem at hand, I’m trying to work out a little piece of code that can tel if an integer is even or not.

Here is a little example :

```
 	ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#0000FF]for[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000] **var** [/COLOR] i:[COLOR=#0000FF]Number[/COLOR] = [COLOR=#000080]0[/COLOR]; i &lt; [COLOR=#000080]100[/COLOR]; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]

```

[COLOR=#000000] **var** [/COLOR] myMc:Movie = [COLOR=#0000FF]this[/COLOR][COLOR=#000000][[/COLOR][COLOR=#FF0000]“myMc”[/COLOR]+i[COLOR=#000000]][/COLOR];  
[COLOR=#808080]_//_[/COLOR]  
[COLOR=#808080]_// here comes the problem_[/COLOR]  
[COLOR=#0000FF]if[/COLOR][COLOR=#000000]([/COLOR]i is an uneven [COLOR=#0000FF]number[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]  
actions go here  
[COLOR=#000000]}[/COLOR] [COLOR=#0000FF]else[/COLOR] [COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR]i is an even [COLOR=#0000FF]number[/COLOR] [COLOR=#000000]{[/COLOR]  
actions go here  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

thats pretty much what I’m trying to get done, and I really can’t come up with any kind of calculation to check for even or uneven numbers  
Any help or insight would be greatly appreciated  
thx
