Skip navigation
Mikheil Abesadze
Currently Being Moderated

AS3 Color Tweening

May 16, 2012 12:56 AM

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

 
Replies
  • Currently Being Moderated
    May 16, 2012 1:38 AM   in reply to Mikheil Abesadze

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

     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2012 11:51 PM   in reply to Mikheil Abesadze

    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...

     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2012 3:52 AM   in reply to Mikheil Abesadze

    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);

     
    |
    Mark as:
  • Currently Being Moderated
    May 20, 2012 9:24 PM   in reply to Mikheil Abesadze

    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....

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points