When code like this
moduleInfo.addEventListener(ModuleEvent.READY,function(e:ModuleEvent):void{
var module:Object=moduleInfo.factory.create();
var elem:IVisualElement=module as IVisualElement;
isModuleLoaded=true;
});
We can see the var module and elem are not null.
But when we add a little nonsense code
moduleInfo.addEventListener(ModuleEvent.READY,function(e:ModuleEvent):void{
var module:Object=moduleInfo.factory.create();
var elem:IVisualElement=module as IVisualElement;
if (elem is IGuipModule){
}
isModuleLoaded=true;
});
the var module and elem become null.
So,what's wrong???