Archive for the 'Books' Category

Conversion to Primitive Types

When I first determined to datatype my codes strictly, I had this illusion that I must assign everything according to their data types. Here’s an example of me being disillusioned :P :

var age:uint = 2; // hardcoded value for testing
var isBorn:Boolean = ( age == 0 ) ? false : true;
trace( isBorn ); // returns true.
 
age = 0;
isBorn = ( age == 0 ) ? false : true;
trace( isBorn ); // returns false.

As you can see from the above example, it was not pretty. It was only when I read the section of Conversion to Primitive Types in Essential ActionScript 3.0 did it dispels my misconception. :D

So here’s what I can actually do:

var age:uint = 2;
var isBorn:Boolean = age;
trace( isBorn ); // returns true as well.
 
age = 0;
isBorn = age;
trace( isBorn ); // returns false. Works well!

In another typical scenario, if I wanted to make a movieclip’s visibility to false and alpha to 0, instead of doing:

mc.visible = false;
mc.alpha = 0;

I can just:

mc.visible = mc.alpha = 0;

** Do you see the advantage already? ** :)

More info about type conversions can be found here on Adobe LiveDocs.

The information below is referenced from: Essential ActionScript 3.0 by Colin Moock. Copyright 2007 O’Reilly Media, Inc., 0-596-52694-6
[Table=1][Table=2][Table=3][Table=4][Table=5]

Sphere: Related Content

AddThis Social Bookmark Button

Learning ActionScript 3.0

IMO, ActionScript 3.0 seems like another language altogether, as the similarities with ActionScript 1/2 are not that much at all. Developers may have a tough time to learn (I had my own mental block a while ago), and to designers, it seems nearly impossible to start grasping this new powerful, yet daunting to learn language. :(

The community has been great though. With reference to Guy Watson aka FlashGuru’s post on ActionScript 3 Resources, Trevor McCauley aka Senocular has written a couple of very useful materials to start learning AS3. They’re definitely a great help over the last few days of AS3 development as I’ve referred to them CONSTANTLY. :D

I definitely recommend getting Colin Moock’s book on Essential ActionScript 3.0!

Edit: Check out this google search!

Sphere: Related Content

AddThis Social Bookmark Button

Get your FREE Adobe AIR book!

I’ve read from Daniel Dura’s post yesterday that there’s a new AIR Pocket Guide book for JavaScript Developers on Amazon.

Well, just a day later, I saw this post from ajaxian.com that they have the book for download, FOC!

Get it here!

Sphere: Related Content

AddThis Social Bookmark Button

Introducing Design Patterns

After getting into my third month as a flash developer, I have finally learnt how to use classes in ActionScript effectively in my project. However, there seems to be many places of duplicated codes that I hope will be either able to optimise, or gathered at a central area where they can be reused.

Here comes my current excitement!

Design Patterns!

Just started reading on this book, Head First Design Patterns. Observer, Delegation, Command, MVC, Singleton!!!

Design Patterns here I come!!! w00t~!!~ (Kinda feel that I’m sounding like a complete geek now. :P )

Sphere: Related Content

AddThis Social Bookmark Button