Quick question (I know both work, just wondering what people do in
practice):

Option A: var castVar:Type = uncastVar as Type;

OR

Option B: var castVar:Type = Type(uncastVar);

I've been going with using option A (with "as") mainly because calling
Array(uncastVar) or ArrayCollection(uncastVar) does not cast to Array
or ArrayCollection, but instead instantiates new Arrays, which is
confusing. So instead of trying to remember to do most of my casting
using Type(variable) unless I'm trying to cast to Array, I figured it
was easier to just always use "as". 

Also, is there a specific reason for the choice to not allow
Array(var) to simply cast to an array? It seems a little odd that
casting that works for every other datatype doesn't for one or two.

Reply via email to