打錯事件的keyword,更正即可 = ="
Bad code:
private function onLoaderComplete(e:Event):void { ldr.x = stage.width / 2 -ldr.width / 2; ldr.y = stage.height / 2 -ldr.height / 2; ldr.alpha = 0; Tweener.addTween(ldr, { alpha:1, time:1 } ); this.addChild(ldr); stage.addeventListener(MouseEvent.CLICK, onStageClick); } |
Good code:
private function onLoaderComplete(e:Event):void { ldr.x = stage.width / 2 -ldr.width / 2; ldr.y = stage.height / 2 -ldr.height / 2; ldr.alpha = 0; Tweener.addTween(ldr, { alpha:1, time:1 } ); this.addChild(ldr); stage.addEventListener(MouseEvent.CLICK, onStageClick); } |
No comments :
Post a Comment