Tweening transition of Brightness in ActionScript with Tweener

The trial is designed  for e-Notice project. And the target is to transit the brightness of a MovieClip, it is now can be done with Tweener pretty simply.


Here is a download link for Tweener from its Google Project home page:


http://code.google.com/p/tweener/downloads/list


This is the link of document for brightness:

http://hosted.zeh.com.br/tweener/docs/en-us/properties/ColorShortcuts.html


Snapshot:


trans-brightness


Here are the AS code on the timeline:

  

import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.MouseEvent;

import caurina.transitions.Tweener;
import caurina.transitions.properties.ColorShortcuts;
import caurina.transitions.Equations;

var ldr:Loader;
var rqt:URLRequest;
var lnk:String = "assets/3.jpg";

init();

function init():void
{
	ColorShortcuts.init();
	ldr = new Loader();
	rqt = new URLRequest(lnk);
	ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
	ldr.load(rqt);
}

function imgLoaded(e:Event):void
{
	imgHolder.addChild(Loader(e.target.loader));
	transBtnessBtn.addEventListener(MouseEvent.CLICK, onTrans);
}

function onTrans(me:MouseEvent):void
{
	Tweener.addTween(
					 	imgHolder, 
						{
							time:1.8, 
							_brightness:-2.5,
							transition:Equations.easeOutBack
						} 
					 ); 
}


Link For Fla file:

transition_brightness


reference


http://www.websector.de/blog/2007/08/28/tweener-as3-extension-for-color-properties-_brightness-_contrast-and-_saturation/

http://www.flycan.com.tw/board/modules/newbb/viewtopic.php?topic_id=1210

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值