Archive for the ‘Actionscript’ Category

Actionscript type casting

Friday, April 20th, 2012

While working with actionscript I always forget actionscript type casting, so I’m writing this post to remember it.
var bar:Bar = myObject as Bar;
this will return an instance of the class or null.

-->
var bar:Bar = Bar(myObject);
this will return an instance of the class or raise an exception if the cast is impossible.

If you want to know more about performance you can check this blog post ‘Cast Speed’.