2
我有许多相同的自定义类的对象,另一个自定义类的另一些对象。我想创建一个switch语句来确定对象属于哪个类。下面的代码不能编译,所以我不确定这是否可能。是使用if语句的唯一选择吗?ActionScript - 在switch语句中使用“is”比较?
function mouseClickEventHandler(evt:MouseEvent):void
{
switch (evt.currentTarget)
{
case (is customClassA): trace("is instance of customClassA"); break
case (is customClassB): trace("is instance of customClassB");
}
}
弧度。完全不知道这件事。谢谢! – TheDarkIn1978 2010-09-24 16:31:00
+1。凉。我不知道这是可能的。 – 2010-09-25 03:06:55