AS gradually modify color

ok so I have MovieA, which loads MovieB.

MovieB wants to change the color of the first movie, slowly darkening it.

so I tried a for loop:

darkenBGColor = new Color(_level0.instance1.bg);
darkenCAColor = new Color(_level0.instance1.ca);
for(i = 100; i >= 50; i-1){
dark.ra = i;
dark.ga = i;
dark.ba = i;
darkenBGColor.setTransform(dark);
darkenCAColor.setTransform(dark);
}

but the change happens so fast that you can’t even tell. Is there a way that I can slow this effect down so it looks like I have tweened the change in color over maybe 10 frames?

or if you think it can be more easily done in another manner, please let me know :m:

You could use the onEnterFrame event
Something like this:[AS]darkenBGColor = new Color(myClip);
dark = new Object();
i = 0;
myClip.onEnterFrame = function() {
if (i>50) {
this.onEnterFrame = null;
} else {
i++;
dark.ra = ii/70;
dark.ga = i
i/15;
dark.ba = i*i/12;
darkenBGColor.setTransform(dark);
}
};[/AS]

You may or may not find this thread useful…

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22838

Ahh thats much better lost… im ashamed of my poor example :blush: