Odd or Even number in ActionScript

I was making a project for a client of mine where I had to make a list with two different colors for the items (like the iTunes list) so I started to think of a possible way to make this. It was clear enough I need to know the odd or the even number in order to do that. So I started to do some google search and I got over this blogpost by Keith Peters. I have to say, this is a very interesting way of thinking 😀

iseven = ((num & 1) == 0)

Makes sense when you look at binary numbers:

001 = 1
010 = 2
011 = 3
100 = 4
101 = 5

Each of the odd numbers has a 1 in the far right column. The even numbers have 0 there. Mask it with “& 1″ and you can see which it is.

So I made a for loop and used this code. It works exactly how it was intended to work!!
Thanks Keith Peters for your blogpost 😀

New book

I just got my new ActionScript 3.0 book.
This book was reviewed by Lee Brimelow on theFlashBlog.com and I thought I should try it because I’m still trying to learn AS 3.0
From what I see right now the book is great! It is full-color and the code looks real 😀
So, thank you Lee for letting us know about this book 😉

gotoAndLearn V2

In case you don’t know already, Lee Brimelow lunched gotoAndLearn V2 gotoAndLearn it’s a great flash tutorials site and it’s free!! If you don’t know about it by now, I suggest you take a look.

gotoAndLearn

And you can check the forums too.
It’s the best flash community out there 😉

Analog in, digital out

This books it’s amazing!! I’ve always been a big fun of Brendan Dawes but I never got the chance to read any of his books, until now 😀
The name of his last book is: Analog in, digital out. I’m enjoying it right now.
I believe it’s one of the most interesting books I have.

analog in, digital out

Changes

Today I got my first glasses ever and two new books about flash and ActionScript.

books and glasses2

So those are the books I got:

I have to say that it feels weir to have glasses. I think I have to stick with them a little and then every thing will be back to normal. And by the way, I didn’t know how much I was missing without the glasses 😀