惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 噢耶游戏

星际迷航 致、青春 12306火车票网站自动登录工具 - 噢耶游戏 Compile your AS3 projects with Ant + Flex SDK (all Open Source) 有史以来关于Flash Player的最详细说明 深入理解Flash Player的应用程序域(Application Domains)(转载) - 噢耶游戏 弄了个新blogs 欢迎捧场 - 噢耶游戏 PHP 实用便捷代码(转) Flex中不使用FelxPrintJob通过ExternalInterface直接调用JavaScript利用浏览器本身的功能进行打印 HttpModule 工作原理(转) Flex 拖拽 - 噢耶游戏 - 博客园 ASP.NET防止盗链(转) CS0016: 未能写入输出文件“C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\webapp\2adfa36a\1a90a869\8_prkz0n.dll" 错误的解决办法。 - 噢耶游戏 FLEX 12个基础 很有用的方法 取得工作目录下的文件 Asp.net中防止用户多次登录的方法(转) 大型网站的系统架构(摘) ActionSrcipt 资源 - 噢耶游戏 Flex和.net Webservice之间多层结构开发
一个鼠标拖出一个圆形的简单demo
噢耶游戏 · 2009-09-22 · via 博客园 - 噢耶游戏

好久没上来过了·
感觉自己都不属于这个圈子·~~

这里讲一个鼠标画圆的例子
其中最主要的是圆半径的求法
小学数学勾股定理
转换为计算机语言就是
var radius:Number = Math.sqrt(Math.pow(thisWidth, 2) + Math.pow(thisHeight, 2));

package
{
 import flash.display.*;
 import flash.events.*;
 import flash.display.Sprite;
 import flash.events.*;
 public class CircleDemo extends Sprite
 {

  private var _sprite:Sprite;
  private var pos1:Object;
  private var pos2:Object;

  public function CircleDemo()
  {
   _sprite=new Sprite();
   this.stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
   this.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);

   //drawMyCircle(100,100,50);
  }

  private function drawMyCircle(pointX:Number,pointY:Number,radius:Number):void
  {
   _sprite.graphics.beginFill(0x88FB00,0.4);
   _sprite.graphics.lineStyle(2,0xFFFF00);     
   _sprite.graphics.drawCircle(pointX,pointY,radius);
   _sprite.graphics.endFill();
   this.addChild(_sprite);
   _sprite.addEventListener(MouseEvent.CLICK, clickHandler);
  }

  private function mouseDownHandler(event:MouseEvent):void
  {
   pos1 = {x:event.stageX, y:event.stageY};
  }


  private function mouseUpHandler(event:MouseEvent):void
  {
   pos2 = {x:event.stageX, y:event.stageY};

   var thisWidth:Number = (pos2.x - pos1.x);
   var thisHeight:Number = (pos2.y - pos1.y);
   var radius:Number = Math.sqrt(Math.pow(thisWidth, 2) + Math.pow(thisHeight, 2));
   drawMyCircle(pos1.x,pos1.y,radius);
  }

  private function clickHandler(event:MouseEvent):void
  {
   var thisMC:MovieClip = event.currentTarget as MovieClip;
   thisMC.graphics.clear();
  }
 }
}

噢耶游戏是中国最大的轻社交游戏开发商,致力于手机页游的研发及推广业务。我们首创性地提出了HTML5游戏中心思路,在第三方App 中嵌入式休闲游戏,为开发者提供了全新的应用内游戏解决方案。