/** * 特效类,特效图片加入后,特效显示完毕之后自动消失 * */function Effect(index){ var self = this; base(self,LSprite,[]); var bitmapData; switch(index){ case 0: bitmapData = new LBitmapData(dataList["effects"],99,45,116,96); break; case 1: bitmapData = new LBitmapData(dataList["effects"],102,278,110,88); break; case 2: bitmapData = new LBitmapData(dataList["effects"],357,85,122,127); break; case 3: bitmapData = new LBitmapData(dataList["effects"],346,357,108,99); break; case 4: bitmapData = new LBitmapData(dataList["effects"],246,918,57,62); break; } self.item = new MiddleBitmap(bitmapData); self.item.scaleX = self.item.scaleY = 0.1; self.addChild(self.item); LTweenLite.to(self.item,0.1,{scaleX:2,scaleY:2,ease:Quad.easeInOut}) .to(self.item,0.2,{scaleX:3,scaleY:3,alpha:0,ease:Quad.easeInOut,onComplete:function(obj){ var eff = obj.parent; eff.parent.removeChild(eff); }});}