I wanted to know the difference between using Object(meuobjeto)
and (meuobjeto as Object)
based on the code below:
var mc:MovieClip = new MovieClip(); //Um objeto MovieClip
trace(mc as String); //null
trace(mc as MovieClip); //[object MovieClip]
trace(mc as Number); //null
trace(String(mc)); //[object MovieClip]
trace(MovieClip(mc)); //[object MovieClip]
trace(Number(mc)); //NaN
I always use the as
operator, however, only to show intellisense with the functions of my object and make code writing a bit easier. But what is the difference between the two? Is it okay to use it that way?