- 最后登录
- 2018-12-19
- 注册时间
- 2012-8-20
- 阅读权限
- 90
- 积分
- 54706
- 纳金币
- 32328
- 精华
- 41
|
主场景第一帧
var map:Map=new Map(20,20);var searched:Boolean=false;this.addChild(map);lockBtn.addEventListener(MouseEvent.CLICK,lock);unLockBtn.addEventListener(MouseEvent.CLICK,unLock);rootBtn.addEventListener(MouseEvent.CLICK,setRoot);targetBtn.addEventListener(MouseEvent.CLICK,setTarget);searchBtn.addEventListener(MouseEvent.CLICK,search);map.addEventListener(MouseEvent.CLICK,otherLock);function lock(e:MouseEvent):void{ var theX:int=int(xStation.text); var theY:int=int(yStation.text); if(searched==***e) { map.clear(); searched=false; } map.lock(theX,theY);}function otherLock(e:MouseEvent):void{ var theX:int=int(e.stageX/20); var theY:int=int(e.stageY/20); if(searched==***e) { map.clear(); searched=false; } map.lock(theX,theY);}function unLock(e:MouseEvent):void{ var theX:int=int(xStation.text); var theY:int=int(yStation.text); if(searched==***e) { map.clear(); searched=false; } map.unlock(theX,theY);}function setRoot(e:MouseEvent):void{ var theX:int=int(xStation.text); var theY:int=int(yStation.text); if(searched==***e) { map.clear(); searched=false; } map.setRoot(theX,theY);}function setTarget(e:MouseEvent):void{ var theX:int=int(xStation.text); var theY:int=int(yStation.text); if(searched==***e) { map.clear(); searched=false; } map.setTarget(theX,theY);}function search(e:MouseEvent):void{ map.search(); searched=***e;} 【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/ |
|