- 1、本文档被系统程序自动判定探测到侵权嫌疑,本站暂时做下架处理。
- 2、如果您确认为侵权,可联系本站左侧在线QQ客服请求删除。我们会保证在24小时内做出处理,应急电话:400-050-0827。
- 3、此文档由网友上传,因疑似侵权的原因,本站不提供该文档下载,只提供部分内容试读。如果您是出版社/作者,看到后可认领文档,您也可以联系本站进行批量认领。
查看更多
AS30基础-运动的螺旋
AS3.0 基础-运动的螺旋从内至外var speed:Number 0.3;var radius:Number 0;var angle:Number 0;var xpos:Number;var ypos:Number;var centerX:Number stage.stageWidth / 2;var centerY:Number stage.stageHeight / 2;//生成容器var container:Sprite new Sprite ;//把容器加入舞台的中心container.x centerX;container.y centerY;addChild container ;//设定线条样式 4个像素、白色container.graphics.lineStyle 4, 0xffffff ;//起始点在舞台的中心container.graphics.moveTo 0, 0 ;//注册进入帧事件侦听器 addEventListener Event.ENTER_FRAME, onEnterFrame ;//事件响应函数function onEnterFrame event:Event :void /* Well stop the drawing after the radius is over 100 pixels. We still continue to rotate the container. */ if radius 100 speed 0; container.rotation + 10; else //Increase the radius in each frame radius + 0.5; //New x and y coordinates xpos Math.cos angle * radius; ypos Math.sin angle * radius; //Draw to the new coorninates container.graphics.lineTo xpos,ypos ; //Rotate the container container.rotation + 10; //The greater the speed, the faster we draw circles angle + speed; 从外至内var speed:Number 0.3;var radius:Number 100;var angle:Number 0;var xpos:Number;var ypos:Number;var centerX:Number stage.stageWidth / 2;var centerY:Number stage.stageHeight / 2;//We are going to add all our graphics onto a containervar container:Sprite new Sprite ;//Add the container to the center of the stagecontainer.x centerX;container.y centerY;addChild container ;//Set the containers graphics line style to be 4 pixels and whitecontainer.graphics.lineStyle 4, 0xffffff ;//Starting pointcontainer.graphics.moveTo 100, 0 ;addEventListener Event.ENTER_FRAME, onEnterFrame ;function onEnterFrame event:Event :void /* Well stop the drawing after the radius is under 0 We still continue to rotate the container. */ if radius 0 speed 0; container.rotation + 10; else //Decrease the radius in each frame radius - 0.5; //New x and y coordinates xpos Math.cos angle * radiu
您可能关注的文档
最近下载
知传链电子书
- ACL 的用途-[共3页]-188-思科网络技术学院教程(第6版):路由和交换基础-人民邮电出版社-[加]鲍勃 瓦尚(Bob Vachon)、[美]艾伦 约翰逊(Allan Johnson).pdf
- VLAN 中继-[共3页]-165-思科网络技术学院教程(第6版):路由和交换基础-人民邮电出版社-[加]鲍勃 瓦尚(Bob Vachon)、[美]艾伦 约翰逊(Allan Johnson).pdf
- VLAN 分配-[共6页]-159-思科网络技术学院教程(第6版):路由和交换基础-人民邮电出版社-[加]鲍勃 瓦尚(Bob Vachon)、[美]艾伦 约翰逊(Allan Johnson).pdf
- VLAN 概述-[共4页]-151-思科网络技术学院教程(第6版):路由和交换基础-人民邮电出版社-[加]鲍勃 瓦尚(Bob Vachon)、[美]艾伦 约翰逊(Allan Johnson).pdf
- 帧转发-[共4页]-119-思科网络技术学院教程(第6版):路由和交换基础-人民邮电出版社-[加]鲍勃 瓦尚(Bob Vachon)、[美]艾伦 约翰逊(Allan Johnson).pdf
- RIPv2-[共7页]-90-思科网络技术学院教程(第6版):路由和交换基础-人民邮电出版社-[加]鲍勃 瓦尚(Bob Vachon)、[美]艾伦 约翰逊(Allan Johnson).pdf
- 直连路由-[共4页]-42-思科网络技术学院教程(第6版):路由和交换基础-人民邮电出版社-[加]鲍勃 瓦尚(Bob Vachon)、[美]艾伦 约翰逊(Allan Johnson).pdf
- Azure Web Apps检修和监控-[共10页]-208-DevOps开发运维训练营-人民邮电出版社-[印度]米泰什 索尼(Mitesh Soni).pdf
- Jenkins中的用户管理-[共4页]-197-DevOps开发运维训练营-人民邮电出版社-[印度]米泰什 索尼(Mitesh Soni).pdf
- 用VSTS 进行应用程序生命期管理的端到端自动化编排-[共12页]-183-DevOps开发运维训练营-人民邮电出版社-[印度]米泰什 索尼(Mitesh Soni).pdf
文档评论(0)