实例AS3.0练习:根据鼠标光标所在坐标求取角度
luyued 发布于 2011-02-09 23:43 浏览 N 次
说明:使用Math对象的atan2方法求出鼠标光标所在位置的角度,动态改变对象的旋转位置。
源码:
this.parent.addEventListener("mouseMove",car_move);
function car_move(me:MouseEvent){
var positionX=this.mouseX-car_mc.x;
var positionY=this.mouseY-car_mc.y;
var Radin=Math.atan2(positionY,positionX);
Radin=Radin/(Math.PI/180);
car_mc.rotation=Radin;
}截图:
--
芦笛Kevin.Reed.Lu电话:010-6556-0163手机:156-5223-9440传真:010-80115555-765910飞信:2010-00-910信箱:10010910@163.com抄送:910@37163.cnGtalk:765910@gmail.comMSN:Reed.lu@msn.comQQ:114-9966-910 UC:800-56205This message and any attachments may be privileged, confidential and intended for the addressee(s) or an authorized representative only. If you are not the intended recipient, please be notified that any dissemination, distribution, or copying of this e-mail, parts of it or contained information by any other person is strictly prohibited. If you have received this message in error, please delete it and notify Tevia.Aisa Limited. Our company accepts no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Our company retains the copyright to all e-mail messages sent from its communications systems.
源码:
this.parent.addEventListener("mouseMove",car_move);
function car_move(me:MouseEvent){
var positionX=this.mouseX-car_mc.x;
var positionY=this.mouseY-car_mc.y;
var Radin=Math.atan2(positionY,positionX);
Radin=Radin/(Math.PI/180);
car_mc.rotation=Radin;
}截图:
--
芦笛Kevin.Reed.Lu电话:010-6556-0163手机:156-5223-9440传真:010-80115555-765910飞信:2010-00-910信箱:10010910@163.com抄送:910@37163.cnGtalk:765910@gmail.comMSN:Reed.lu@msn.comQQ:114-9966-910 UC:800-56205This message and any attachments may be privileged, confidential and intended for the addressee(s) or an authorized representative only. If you are not the intended recipient, please be notified that any dissemination, distribution, or copying of this e-mail, parts of it or contained information by any other person is strictly prohibited. If you have received this message in error, please delete it and notify Tevia.Aisa Limited. Our company accepts no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Our company retains the copyright to all e-mail messages sent from its communications systems.
上一篇:《符文工房:海洋》战斗、怪物以及场景画面公开 下一篇:MoveWindow
相关资讯
- 06-04· 竹纤维的优点
- 06-04· ECOH生态家 ecoh.taobao.com 竹
- 06-04· ECOH生态家 ecoh.taobao.com 竹
- 06-03· 【游戏】妈呀,又被凡一
- 06-03· 引用奥运圣火正在传递
- 05-27· 小猪班纳童装官网ef89.co
- 05-18· 老粗布家纺的走向问题
- 05-18· 关中土织布即将走向全球
- 05-16· "为你高兴中国男足."+U F
- 05-13· (原创)蝴蝶
图文资讯
最新资讯
- 05-13· 市场热点处在良性切换中
- 05-13· 旅途印象
- 05-13· [置顶][转载]以花的姿态。
- 05-13· 斑斓的彩翼
- 05-13· 毕业论文愤怒了论文范文
- 05-13· 小德创赛季13连胜 特殊方
- 05-13· 也门10岁女童离婚出版报告
- 05-13· 中国独立音乐厂牌集锦
- 05-13· 音乐--英文词汇
- 05-13· English Renaissance(英国文艺复