木有砸中
来源:互联网 发布:淘宝店怎么开通客服 编辑:程序博客网 时间:2024/05/29 11:05
package {import flash.display.Sprite;import flash.events.Event;import flash.ui.Mouse;import flash.events.MouseEvent;import com.greensock.*;import com.greensock.easing.*;import flash.utils.Timer;import flash.events.TimerEvent;import flash.net.URLRequest;import flash.net.URLLoader;import flash.net.URLRequestMethod;import flash.external.ExternalInterface;public class init extends Sprite{private var ScratchRequest:URLRequest;private var egg1:Egg = new Egg();private var egg2:Egg = new Egg();private var egg3:Egg = new Egg();private var pro:Prompt = new Prompt();private var hammer:Hammer = new Hammer();private var timer:Timer;private var Twtimer:Timer;private var dotrueTimer:Timer;private var doStatus:Boolean = true;private var itme:Itme = new Itme();private var statusId:int = 1;private var phpurl:String = "";private var btDetecting:Boolean = true;public function init(){// constructor codeMouse.hide();phpurl = stage.loaderInfo.parameters.phpurl;ScratchRequest = new URLRequest(phpurl);hammer.mouseEnabled = false;getValueFromPHP();constructorFun();}private function getValueFromPHP():void{var urlLoader:URLLoader = new URLLoader();ScratchRequest.method = URLRequestMethod.POST;urlLoader.addEventListener(Event.COMPLETE,loaderCompleteHandler);//urlLoader.load(ScratchRequest);}function loaderCompleteHandler(evt:Event){trace(evt.target.data);if (evt.target.data == "true"){btDetecting = true;}else{btDetecting = false;}}function showFailure():void{ExternalInterface.call("showFailure");}private function constructorFun():void{addChild(egg1);addChild(egg2);addChild(egg3);addChild(hammer);egg1.x = 358;egg2.x = 605;egg3.x = 857;egg1.y = egg2.y = egg3.y = 171;addEventListener(Event.ENTER_FRAME,enter_frameHandler);addEventListener(MouseEvent.CLICK,stageClickHandler);}private function alertfun(x:int,y:int):void{timer = new Timer(900,1);timer.addEventListener(TimerEvent.TIMER_COMPLETE,timerComplete);addChild(pro);pro.scaleX = 0;pro.scaleY = 0;pro.x = x;pro.y = y;addChild(hammer);timer.start();dotrueTimer = new Timer(2000,1);dotrueTimer.addEventListener(TimerEvent.TIMER,dotrueTimerComplete);if (x == 348){statusId = 1;dotrueTimer.start();}if (x == 596){statusId = 2;dotrueTimer.start();}if (x == 851){statusId = 3;dotrueTimer.start();}}private function dotrueTimerComplete(e:TimerEvent):void{eggComplete(statusId);dotrueTimer.stop();dotrueTimer = null;}private function eggComplete(value:int):void{Twtimer = new Timer(500,2);Twtimer.addEventListener(TimerEvent.TIMER,TwtimerComplete);statusId = value;Twtimer.start();}private function TwtimerComplete(E:TimerEvent):void{if (statusId == 1){TweenLite.to(egg2, .1, {rotation:-6, onComplete:eggComplete2});}if (statusId == 2){TweenLite.to(egg3, .1, {rotation:-6, onComplete:eggComplete2});}if (statusId == 3){TweenLite.to(egg1, .1, {rotation:-6, onComplete:eggComplete2});}}private function eggComplete2():void{if (statusId == 1){TweenLite.to(egg2, .1, {rotation:6,onComplete:eggComplete3});}if (statusId == 2){TweenLite.to(egg3, .1, {rotation:6,onComplete:eggComplete3});}if (statusId == 3){TweenLite.to(egg1, .1, {rotation:6,onComplete:eggComplete3});}}private function eggComplete3():void{addChild(itme);addChild(hammer);itme.y = 0;if (statusId == 1){TweenLite.to(egg2, .1, {rotation:0});itme.x = 654;}if (statusId == 2){TweenLite.to(egg3, .1, {rotation:0});itme.x = 901;}if (statusId == 3){TweenLite.to(egg1, .1, {rotation:0});itme.x = 395;}showFailure();}private function timerComplete(e:TimerEvent):void{TweenLite.to(pro, 1, {scaleX:1, scaleY:1, ease:Back.easeInOut});//removeEventListener(MouseEvent.CLICK,stageClickHandler);}private function stageClickHandler(e:MouseEvent):void{TweenLite.to(hammer, .25, {rotation:-220});TweenLite.to(hammer, .25, {rotation:0});trace(e.target.name);if (btDetecting){if (doStatus){doStatus = false;if (e.target.name == "instance3"){addChild(egg1);addChild(hammer);egg1.gotoAndPlay(2);alertfun(348,84);}if (e.target.name == "instance6"){addChild(egg2);addChild(hammer);egg2.gotoAndPlay(2);alertfun(596,84);}if (e.target.name == "instance9"){addChild(egg3);addChild(hammer);egg3.gotoAndPlay(2);alertfun(851,84);}}}else{ExternalInterface.call("showPrompt");}}private function enter_frameHandler(e:Event):void{hammer.x = stage.mouseX;hammer.y = stage.mouseY;}}}
js
<script type="text/javascript">function showFailure(){setInterval(function (){$('#mabi-tc').show();}, 2000);}function showPrompt(){$('.zadanPrompt').show();}$(document).ready(function(){$('.zadanPrompt').css('opacity',0.5);$('.zadanPrompt a').click(function (){$('.zadanPrompt').hide();});$('.mabi-guanbi').click(function(){$('.sheet-overlay').hide();$('#mabi-tcdl').hide();});$('.button').click(function (){$('#mabi-tcdl').hide();$('.sheet-overlay').hide();if(0){$('#zadana').show();}else{$('#zadana').hide();}//$('#zadana').hide();});$('#zadana').bind('click',function(){$('#mabi-tcdl').show();$('.sheet-overlay').show();});});</script>
0 0
- 木有砸中
- ubuntu12.04 安装qt4时碰到黑屏问题
- 指针难,算法难,难住了谁
- 制作theano可用的训练样本
- 好的资源地址
- tools
- 木有砸中
- 在MAC OS X 10.9下编译CUDA 5.5例子程序出错解决方案
- oracle数据库转移(备份)的一次实践
- 使用INTERVAL DAY TO SECOND类型
- 数据库的粗略复习(一)
- SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoade
- SQL2000数据库查询讲解009--对查询结果排序
- 不入库的永久递增
- JS——杂知识点