• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

AS3 Color Tweening

Explorer ,
May 16, 2012 May 16, 2012

Copy link to clipboard

Copied

Have Adobe simple Color Tweening code, like this caurina code : Tweener.addTween(myClip, {_color: 0x000000, time:1, transition:"easeOut"}); ?

TOPICS
ActionScript

Views

6.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 16, 2012 May 16, 2012

Copy link to clipboard

Copied

As per my knowledge using colorTransform is the way to color tweening in as3.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 16, 2012 May 16, 2012

Copy link to clipboard

Copied

That's nice. can you write here an example of this code ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 16, 2012 May 16, 2012

Copy link to clipboard

Copied

var myColor:ColorTransform = new ColorTransform();

myColor.color = 0x000000;        //Here you can give the color whatever you want...

myClip.transform.colorTransform = myColor;         //Here myClip is your object...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 17, 2012 May 17, 2012

Copy link to clipboard

Copied

It's working perfect, but it has no tween effect. I mean color changing fastly, not ease. Is there some solution ? Thank you

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 17, 2012 May 17, 2012

Copy link to clipboard

Copied

Hi ,

U can use Tween Class To Ease,

  please use this one

import fl.transitions.Tween;
import fl.transitions.easing.*;

var myColor:ColorTransform = new ColorTransform();

myColor.color = 0x000000;        //Here you can give the color whatever you want...

myClip.transform.colorTransform = myColor;  

var myTween = new Tween(myClip,'alpha',Strong.EaseIn,0,1,5,true);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 19, 2012 May 19, 2012

Copy link to clipboard

Copied

Sumit Agrawal FLash

Hi

There is different between this two method. caurina tweener makess one color to other colo, for example 0X000000 to 0X333333.

Adobe tween removes one color and starts new color from null.

Here is en examples of this two clases :

Caurina Tweener:

Tweener.addTween(myClip, {_color: 0x333333, time:1, transition:"easeOut"});

Adobe Tween:

var myColor:ColorTransform = new ColorTransform();

          myColor.color = 0x333333;

          myClip2.transform.colorTransform = myColor;

          var myTween = new Tween(myClip2,'alpha',Strong.easeOut,0,1,3,true);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 20, 2012 May 20, 2012

Copy link to clipboard

Copied

LATEST

import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.geom.ColorTransform;

var timer:Timer = new Timer(1000,0);
var arr:Array = [0x000000,0xff0000,0x00ff00,0x0000ff,0xffff00,0xff00ff,0x00ffff];
var carr:Array = [];

timer.addEventListener(TimerEvent.TIMER,changeColor);
timer.start();
function changeColor(e:TimerEvent):void
{
trace("timer");
var color:ColorTransform = new ColorTransform();
var num:Number = Math.floor(Math.random() * arr.length);
color.color = arr[num];
arr.splice(num,1);
mc.transform.colorTransform = color;
}

Try this code....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines