-
Getting errors with TweenColorTransform
Hello.
I need to rewrite a code made in AS2 to AS3. I have the following code:
import mx.transitions.TweenColorTransform;
import mx.transitions.easing.*;
import flash.geom.ColorTransform;
var tween01 = new TweenColorTransform(
myBall1_mc, // movie clip to tween
"", // property to tween
Strong.easeOut, // easing function
myBall1_mc.transform.colorTransform, // start transform
new ColorTransform(2, 1, 10,0,255,255,255,-255), // final transform
1.5, // seconds duration
true); // use seconds for duration (false = use frames)
// color transform yoyo
tween_ct.onMotionFinished = function()
{
tween_ct.yoyo();
}
But when I test this code am getting the following error:
"The class or interface 'mx.transitions.TweenColorTransform' could not be loaded."
Does someone know what I have to do for getting it run properly?
Thank you very much in advance!
-
https://forums.adobe.com/thread/1005703 This looks like what you'd want. Just look down a few posts.
I think this might be what you're looking for:
code: 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);
-
I've found the solution...
Thank you very much for your reply. I was still looking for some information about and I found out the TweenColorTransform is an extension of the Color Tween Classes v1.0. Seems it's not available anymore but I was testing that code and realized that replacing the first line:
Code:
import mx.transitions.TweenColorTransform;
By this one:
Code:
import mx.transitions.*;
The error has gone and the code is working fine. Now I can start to write the same code in AS3...
Thank you for the link and thank you very much for your cool reply!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|