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

推荐订阅源

MongoDB | Blog
MongoDB | Blog
Recorded Future
Recorded Future
Jina AI
Jina AI
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
F
Fortinet All Blogs
人人都是产品经理
人人都是产品经理
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
博客园 - 【当耐特】
雷峰网
雷峰网
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
Security Latest
Security Latest
有赞技术团队
有赞技术团队
L
Lohrmann on Cybersecurity
P
Proofpoint News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
P
Privacy & Cybersecurity Law Blog
Scott Helme
Scott Helme
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Hacker News - Newest:
Hacker News - Newest: "LLM"
NISL@THU
NISL@THU
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
B
Blog RSS Feed
Cyberwarzone
Cyberwarzone
K
Kaspersky official blog
F
Full Disclosure
Martin Fowler
Martin Fowler
Spread Privacy
Spread Privacy
D
Docker
C
Cisco Blogs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page

博客园 - 噢耶游戏

星际迷航 致、青春 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 中嵌入式休闲游戏,为开发者提供了全新的应用内游戏解决方案。