You can upcast or downcast an instance (to a superclass or subclass) using this syntax:
var i:MyClass = MyClass(instance);
But what does the as keyword do?
var i:MyClass = (instance as MyClass);
Are they equivalent? or am I missing something here…
To put it in a few words:
asis an operator. The reference states: “If the first operand is a member of the data type, the result is the first operand. Otherwise, the result is the value null”suppose, you have a class A and a class B.