[ActionScript 3.0] AS3实现图像径向转旋效果
原图 
效果 
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.BlendMode;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.BlurFilter;
import flash.geom.ColorTransform;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.text.TextField; var bmd:BitmapData;
var screen:Bitmap;
var scale:Number;
var r:Number; bmd = new 位图1();
screen = new Bitmap(bmd.clone());
addChild(screen); scale = 1.0;
r = 0.0; stage.addEventListener(MouseEvent.CLICK,onClick);
function onClick(event:MouseEvent):void
{
if (hasEventListener(Event.ENTER_FRAME)) {
removeEventListener(Event.ENTER_FRAME,onEnterFrame);
scale = 1.0;
r = 0.0;
screen.bitmapData = bmd.clone();
} else {
addEventListener(Event.ENTER_FRAME,onEnterFrame);
}
} function onEnterFrame(event:Event):void
{
r += 0.05;
scale *= 1.05;
var m:Matrix = new Matrix();
m.translate(-bmd.width / 2,-bmd.height / 2);
m.scale(scale,scale);
m.rotate(r);
m.translate(bmd.width / 2,bmd.height / 2);
screen.bitmapData.draw(bmd,m,new ColorTransform(1,1,1,0.2),BlendMode.ADD);
}
[ActionScript 3.0] AS3实现图像径向转旋效果的更多相关文章
- [ActionScript 3.0] AS3.0 动态加载显示内容
可以将下列任何外部显示资源加载到 ActionScript 3.0 应用程序中: 在 ActionScript 3.0 中创作的 SWF 文件 — 此文件可以是 Sprite.MovieClip 或扩 ...
- [ActionScript 3.0] as3处理xml的功能和遍历节点
as3比as2处理xml的功能增强了N倍,获取或遍历节点非常之方便,类似于json对像的处理方式. XML 的一个强大功能是它能够通过文本字符的线性字符串提供复杂的嵌套数据.将数据加载到 XML 对象 ...
- [ActionScript 3.0] AS3.0 把图片分析成文本表现形式
PLP%uffs??1ti4b5I3iI5CMMGGE8Ta8?c8[mm3CF9sLaXZDll6kpjmhGmhE$GONEENhhGl6OWXb9lkNk0kkNpklZW6&bDN0q ...
- [ActionScript 3.0] AS3.0 将图像的Alpha通道转换为黑白图像(分离ARGB方式)
import flash.display.BitmapData; import flash.display.Bitmap; /** * 将图像的Alpha通道转换为黑白图像(分离ARGB方式) */ ...
- [ActionScript 3.0] AS3.0将图像的Alpha通道转换为黑白图像(复制通道方式)
import flash.display.BitmapData; /** * 将图像的Alpha通道转换为黑白图像 */ var p:Point = new Point(0,0); var bmpd: ...
- [ActionScript 3.0] AS3 深入理解Flash的安全沙箱Security Domains
简介 如果你还没有与复杂的的安全域(security domain)和应用程序域(application domain)问题打过交道,那么你真是个幸运的家伙.当你在加载外部内容(然后他们开始播放)的时 ...
- [ActionScript 3.0] AS3.0和AS2.0的相互通信
AS3和AS2之间的通信,最好的方式可能就是LocalConnection了. AS2向AS3发送数据,即AS2调用AS3的函数: as2.0代码(按钮上写的发送信息代码): on (release) ...
- [ActionScript 3.0] AS3.0 涂鸦及擦除功能,撤销重做步骤记录实例
package { import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.BlendMo ...
- [ActionScript 3.0] AS3.0 本机鼠标指针
Flash Player 10.2添加了内置的本机鼠标指针(native mouse cursor)支持,虽然在之前的版本里我们可以侦听MouseEvent事件来模拟鼠标指针,但是在有了原生的本机鼠标 ...
随机推荐
- 在Linux中搭建一个FTP服务器
在Linux中搭建一个ftp服务器,以供两个工作小组保管文件使用.禁用匿名.第一个小组使用ftp账号:ftp1,工作目录在:/var/ftp/ftp1:第二个小组使用ftp2,工作目录在:/var/f ...
- python子类分配
原问题是将左边样式变成右边样式: 即有父类和子类,父类包括多个子类,怎样将子类匹配到父类下面的问题 代码如下 #!/usr/bin/python3.4 # -*- coding: utf-8 -*- ...
- @media_screen
html,body{ margin:0; padding:0; }body{ background:#0f0;} /* @media screen and (min-width: 800px)and( ...
- [Hibernate] - Annotations - One To Many
Hibernate使用Annotation的一对多: hibernate.cfg.xml <?xml version="1.0" encoding="UTF-8&q ...
- 使用UpdatePanel 页面脚本不起作用
在后台中这样注册js方法 ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "", " ...
- 【maven】之开发pom配置常用插件
1.打包跳过测试代码 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId&g ...
- ibatis CDATA
在使用ibatis时,经常需要配置待执行的sql语句.使用过ibatis的朋友都知道,无可避免的都会碰到一些不兼容.冲突的字符,多数人也都知道用<![CDATA[ ]]>标记避免Sql ...
- 在Visual Studio 2010/2012中 找不到创建WebService的项目模板
参考文章: http://blog.sina.com.cn/s/blog_6d545999010152wb.html 在 Visual Studio 2010 或者2012的新建 Web 应用程序或者 ...
- U3d中实现A*寻路,附源文件
图片看不清楚,请点击看大图 http://pan.baidu.com/s/1pKwmOYn 写了好多,没保存,哎哎哎 空格键开始移动
- OAF_VO系列4 - Row Imp的分析(概念)
20150706 Created By BaoXinjian