⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oval_circle_draw.as

📁 这是《Flash MX编程与创意实现》的源代码
💻 AS
字号:
/*
  Oval and Circle Drawing v1.0
  Oct. 29, 2002
  adapted from Casper Schuirink's drawCircle()
  
  MovieClip methods to draw ovals (ellipses) and circles.
  
  Discussed in Chapter 10 of 
  Robert Penner's Programming Macromedia Flash MX
  
  http://www.robertpenner.com/profmx
  http://www.amazon.com/exec/obidos/ASIN/0072223561/robertpennerc-20
*/


MovieClip.prototype.drawOval = function (x, y, rx, ry) {
    this.moveTo (x+rx, y);
    this.curveTo (rx+x, 0.4142*ry+y, 0.7071*rx+x, 0.7071*ry+y);
    this.curveTo (0.4142*rx+x, ry+y, x, ry+y);
    this.curveTo (-0.4142*rx+x, ry+y, -0.7071*rx+x, 0.7071*ry+y);
    this.curveTo (-rx+x, 0.4142*ry+y, -rx+x, y);
    this.curveTo (-rx+x, -0.4142*ry+y, -0.7071*rx+x, -0.7071*ry+y);
    this.curveTo (-0.4142*rx+x, -ry+y, x, -ry+y);
    this.curveTo (0.4142*rx+x, -ry+y, 0.7071*rx+x, -0.7071*ry+y);
    this.curveTo (rx+x, -0.4142*ry+y, rx+x, y);
}; // adapted from Casper Schuirink's drawCircle()


MovieClip.prototype.drawCircle = function (x, y, r) {
	this.drawOval (x, y, r, r);
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -