易截截图软件、单文件、免安装、纯绿色、仅160KB

flash 绘图API:绘制小鱼

演示地址:  
forked from: SimpleFish - wonderfl build flash online
 今天我们要创建一个小鱼的绘制。这次我们会使用SimpleFish.as 创建绘制小鱼类 。同时我们会使用绘图APi 当中的curveTo 的一个方法。这个方法用法如下,
    this.graphics.moveTo(开始起点X,开始起点Y);
    this.graphics.curveTo(控制点X, 控制点Y ,目标点X, 目标点Y);
我们以下面的图作为一个设计图案。,可以看出这次绘制,我们使用的办法采用拼合的组合方式进行。当中我们使用的曲线绘制,
圆的绘制,以及使用描线的办法进行连线。
我们从开始的点(0,0)进行作为,鱼身高度的一半作为控制点坐标。而鱼尾巴就进行连线的。
解决了这个曲线的问题,接下来就是组合的问题了。当然这条鱼是没有加鱼翅的。所以这种鱼叫做简单无手鱼也不是没有道理吧,应该给他改个好名字。
 定好起初的点,同时定好控制点和目标点。这样我们的曲线就能绘制出来了
下面是一个提供写好的小鱼类
///SimpleFish.as 该类为简单鱼
//vesion 1.0
//author 夏天的树人
package
{
import flash.geom.Point;
import flash.display.Sprite;
public class SimpleFish extends Sprite
{
public var speed:Number;
public function SimpleFish()
{
}
public function clone():SimpleFish
{
return new SimpleFish();
}

//创建简单的鱼
public function CreatSimpleFish(Width:Number,Height:Number,eyes_Width:Number=5,Fish_rear:Number=50,n:int=4):void
{

this.graphics.lineStyle(1,0x000000);
this.graphics.moveTo(0,0);
this.graphics.curveTo(Width/2, Height, Width, 0);
this.graphics.moveTo(0,0);
this.graphics.curveTo(Width/2, -Height, Width, 0);

this.graphics.drawCircle(Width/5,0,eyes_Width);

this.graphics.moveTo(Width/4,-Height/2.7);
this.graphics.curveTo(Width/3, 0, Width/4, Height/2.7);


//创建鱼尾
this.graphics.moveTo( Width, 0);
this.graphics.lineTo( Width+Width/n, Fish_rear);

this.graphics.moveTo( Width, 0);

this.graphics.lineTo( Width+Width/n, -Fish_rear);
this.graphics.lineTo( Width+Width/n,


相关文档:

object的flash在firefox上显示不出来的问题

Dreamweaver中自带的flash是:
<object ..... >
  <param .../>
</object>这种,而它在firefox中显示不出来,
而我在网上看到有人用:
<object .....>
  <embed .../>
</object>来做在火狐上能显示,但在ie上就不能显示了,并接如果用fckeditor不能提交到数据库 ......

关于flash性能优化的好书

  这本书主要是讲性能优化的!总共只有 85页,蛮少的@^_^ !  废话不多说:
目录
Introduction
Conserving memory
Minimizing CPU usage
ActionScript 3.0 performance
Rendering performance
Optimizing network interaction
Working with media
SQL Database performance
Benchmarking and d ......

首页flash翻滚焦点图的简单实现

配合焦点图flash使用,原来是取得最新的图片文章,然后把相关信息作为参数传递给flash播放。
focus.asp代码如下:
<!--#Include File="conn.asp" -->
<!--#Include File="include/inc.asp"-->
<%
'首页焦点页面
'by winston
'2010/05/15
Dim QueryArray
Dim FocusLinks,FocusP ......

flash与php结合实现IP及归属地查询

数据库是 纯真数据库 格式为 UTF-8  txt格式
php文件是UTF-8编码 
demo :      http://dreamnight.gicp.net/zendphp/IP/connect.swf
flash端:
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.ProgressEvent;
//i ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号