'as' Keyword in Actionscript 3.0
Posted
Saturday, December 31, 2005 11:17 PM
by
Shunjie
I am not sure if this is documented or I cannot find, but the 'as' keyword can actually work in Actionscript 3.0. I try it as I want to type cast an object from getChildByName from a Container object and cast it into a Canvas. Something like this:
import mx.core.*;
import mx.containers.*;
var mainCanvas:Canvas =
main_app.getChildByName(main_app.CANVAS) as Canvas;
I tot of trying it out since I always do that in C#. Pardon me if this is already well known as I am pretty new to AS3.0. If you know where to find the documentation for AS3.0 (Except live docs), do drop a comment!