开发环境:Flash builder 4,SDK 4.1
源代码 :
if (ColonyHandler.getInstance() != null)
{
try
{
var colonyA:ColonyHandler = ColonyHandler.getInstance();
trace(colonyA);
ColonyHandler.getInstance().onMouseMove(event);
}
catch(error:*)
{
var colonyB:ColonyHandler = ColonyHandler.getInstance();
trace(colonyB);
}
}
问题:colonyA 不为空,colonyB 为空。getInstance() 方法返回名为“实例”的静态变量。这可能吗?