# Box colour change

**URL:** <https://forum.kirupa.com/t/box-colour-change/23285>\
**Category:** flash\
**Created:** [June 15, 2003, 10:03pm UTC](https://forum.kirupa.com/t/box-colour-change/23285 "2003-06-15T22:03:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cookie](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@cookie](https://forum.kirupa.com/u/cookie)\
**Post date:** [June 15, 2003, 10:03pm UTC](https://forum.kirupa.com/t/box-colour-change/23285/1 "2003-06-15T22:03:25Z")

</div>

I have a box which covers part of the stage and I want this box to change colour, but not any colours just a few that I pick. I want the transition between the colours to be as smooth as possible and not too fast. Can this be done with AS?:crazy:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 15, 2003, 10:15pm UTC](https://forum.kirupa.com/t/box-colour-change/23285/2 "2003-06-15T22:15:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 15, 2003, 10:33pm UTC](https://forum.kirupa.com/t/box-colour-change/23285/3 "2003-06-15T22:33:18Z")

</div>

Thanks for the link lost but where do i put the code?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 15, 2003, 10:39pm UTC](https://forum.kirupa.com/t/box-colour-change/23285/4 "2003-06-15T22:39:19Z")

</div>

in the main timeline? remember to use your movie clips name rather than ‘myMovieClip’ or ‘this’

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 20, 2003, 9:02pm UTC](https://forum.kirupa.com/t/box-colour-change/23285/5 "2003-06-20T21:02:30Z")

</div>

Ok I have created an example of the effect I want to achieve with AS! I have attached my file and I hope that someone can help me with the code so that the tweening between the colours that I have used is smooth! Perhaps the whole thing can be done without the use of several instances of the same bg symbol, as I have done now?

Thanks :tie:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 21, 2003, 4:26am UTC](https://forum.kirupa.com/t/box-colour-change/23285/6 "2003-06-21T04:26:11Z")

</div>

you want the color in the background to cycle?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 22, 2003, 6:50pm UTC](https://forum.kirupa.com/t/box-colour-change/23285/7 "2003-06-22T18:50:51Z")

</div>

YES!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 22, 2003, 7:16pm UTC](https://forum.kirupa.com/t/box-colour-change/23285/8 "2003-06-22T19:16:46Z")

</div>

With your setup it would be easiest to just right click between each keyframe and choose “Insert Motion Tween” to create a motion tween between each one.

Considering you are using gradients you could only fade them either through tweens or via beginGradientFill() in the drawing API with Flash MX. And lemme tell ya, that beginGradientFill() isn’t for beginners :hangover:
