This site requires flash player 9 or later.
import com.flashdynamix.motion.Tweensy;
import com.flashdynamix.motion.TweensyGroup;
import com.flashdynamix.motion.TweensyTimeline;
import com.flashdynamix.motion.TweensySequence;
import com.flashdynamix.motion.*;
import fl.motion.easing.*;
import com.flashdynamix.motion.easing.BackEaseParams;
import com.flashdynamix.motion.easing.ElasticEaseParams;
/**
* 色を変化させる
*
* @param e - イベント
*/
function changeColor(e:MouseEvent):void {
var tg:TweensyGroup = new TweensyGroup();
tg.stop(target_mc, "redOffset", "blueOffset", "greenOffset", "alphaOffset", "redMultiplier", "blueMultiplier", "greenMultiplier", "alphaMultiplier");
tg.colorTransformTo(target_mc, new ColorTransform(0, 0, 0, 1, 256 * Math.random(), 256 * Math.random(), 256 * Math.random(), 0), 1, Quadratic.easeOut);
}
/**
* 輝度を変化させる
*
* @param e - イベント
*/
function changeBrightness(e:MouseEvent):void {
var tg:TweensyGroup = new TweensyGroup();
tg.stop(target_mc, "redOffset", "blueOffset", "greenOffset", "alphaOffset", "redMultiplier", "blueMultiplier", "greenMultiplier", "alphaMultiplier");
tg.brightnessTo(target_mc, .6, 1, Quadratic.easeOut);
}
/**
* コントラストを変化させる
*
* @param e - イベント
*/
function changeContrast(e:MouseEvent):void {
var tg:TweensyGroup = new TweensyGroup();
tg.stop(target_mc, "redOffset", "blueOffset", "greenOffset", "alphaOffset", "redMultiplier", "blueMultiplier", "greenMultiplier", "alphaMultiplier");
tg.contrastTo(target_mc, .6, 1, Quadratic.easeOut);
}
/**
* 色を戻す
*
* @param e - イベント
*/
function defaultColor(e:MouseEvent):void {
var tg:TweensyGroup = new TweensyGroup();
tg.stop(target_mc, "redOffset", "blueOffset", "greenOffset", "alphaOffset", "redMultiplier", "blueMultiplier", "greenMultiplier", "alphaMultiplier");
tg.brightnessTo(target_mc, 0, 1, Quadratic.easeOut);
}
btn1_mc.addEventListener(MouseEvent.CLICK, changeColor);
btn1_mc.buttonMode = true;
btn2_mc.addEventListener(MouseEvent.CLICK, changeBrightness);
btn2_mc.buttonMode = true;
btn3_mc.addEventListener(MouseEvent.CLICK, changeContrast);
btn3_mc.buttonMode = true;
btnReset_mc.addEventListener(MouseEvent.CLICK, defaultColor);
btnReset_mc.buttonMode = true;