Browse > Home / Archive: October 2008

| Subcribe via RSS

Pixel Art Drawing Application (v2)

October 29th, 2008 | 2 Comments | Posted in Experiments

As promised, a new update of the pixel art drawing application is posted up here. It now has a color picker, a grid to toggle on and off, a scalable drawing area, and a clear all button. You can create some pretty nice pixel art and pixel fonts. :) I still plan to develop this a lot further. Please comment on any suggestions you might have and I would love to see anything you create using this. Please feel free to mess around with it below, take a screenshot of what you made, and send it to my email (please email me first through my website).

Pixel Art Drawing Application

October 27th, 2008 | No Comments | Posted in Experiments

Another experiment; pretty simple and basic at this stage, but I plan to implement many more features to create a kind of pixel art drawing application. I think it could be really fun, so come back some time to see more versions/updates on this! :)

Flash Tip: Casting

October 17th, 2008 | 5 Comments | Posted in ActionScript

Casting can be very useful and in some cases, necessary. AS3 has a system of strict datatyping, much like AS2, but now even more strict. Using casting, you can transform one datatype into another, so to speak. For example, if you are receiving a string in Flash, say “item07″ and you need to use the number from that string, you can extract that using String methods and then cast the string into a uint datatype or Number datatype. Here is a working example of why you would do this, in AS3 code:

var str:String = "item07";
str = str.substr(4);
str += 3;
trace(str); // this will give the result of str being 073

var str:String = "item07";
str = str.substr(4);
var res:uint = uint(str) + 3;
trace(res); // this will give the result of res being 10


The uint(str) is where casting is used. The way you cast a datatype is you wrap it in a different datatype. For example, you can use MovieClip(value), Number(value), String(value), etc. Also, sometimes in situations, I have to use casting to refer to a movie clip in the parent clip, …MovieClip(parent).myMovieClip…
I hope you found this useful, thanks.