Color Value To Hexadecimal

A simple utility class that will help you convert a color value (from numbers) to hexadecimal color value.

Basically you can convert the color value to hex string with colorNumber.toString(16);
Now, if you have this shade of blue “13311”, for example, it will be converted to “33ff”.

You can fix that with while(hexColor.length < 6) and add “0” to in front of the hex color output.

Read more
Using lineStyle to draw stroke without affecting the size of the holder container

Have you ever tried to use the graphics class to draw a rectangle with a lineStyle (stroke) and then set bigger width and height values for the container that holds the graphic? If so, you probably noticed that there is a size difference between a rectangle with lineStyle and a rectangle without lineStyle.

If you trace the width and height values of the container, everything seems to be fine. Only if you run and look at the SWF you’ll notice a visual difference between those two (top image).

Read more