AS3: cast or “as”?

前端 未结 8 1717
天命终不由人
天命终不由人 2020-11-30 10:25

Is there any difference of use, efficiency or background technique between

var mc:MovieClip = MovieClip(getChildByName(\"mc\"));

and

<
8条回答
  •  旧时难觅i
    2020-11-30 10:46

    AS3 Casting one type to another contains the answer that answers this as well: the "as" keyword assigns null when the conversion fails, otherwise it throws a TypeError.

提交回复
热议问题