# Voetsjoeba's Button moveEase Movie clip

**URL:** <https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155>\
**Category:** flash\
**Created:** [August 23, 2003, 12:10am UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155 "2003-08-23T00:10:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![skidpanda](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@skidpanda](https://forum.kirupa.com/u/skidpanda)\
**Post date:** [August 23, 2003, 12:10am UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/1 "2003-08-23T00:10:01Z")

</div>

Hello!

In another post I saw Voetsjoeba giving AS code on how to make a movieclip move/ease to hover over whatever button was rolled over, you said to ask about changing the MC size… but what I want to know is can the MC be tinted to a differnt colour depending on what button is rolled over? Like 50% red tint on one button then 50% blue tint on another button?

Any idea how to do that Voetsjoeba? or anyone else?

Cheers

---

<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:** [August 23, 2003, 2:05am UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/2 "2003-08-23T02:05:47Z")

</div>

how about using getRGB() and setRGB()?

just a though… voets might be able to help more, because i don’t know exactly what you are working with.

---

<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:** [August 23, 2003, 2:09am UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/3 "2003-08-23T02:09:55Z")

</div>

This was the post with the code I got:

* * *

On the movieclip that you want to ease into position, place this AS

ActionScript:-------------------------------

onClipEvent(load){  
\_root.tarX = initialxposition  
\_y = initialyposition  
}  
onClipEvent(enterFrame){  
\_x = \_root.tarX-(\_root.tarX-\_x)/1.2  
}

* * *

Change initialxposition and initialyposition to the x and y positions of where you want the movieclip to start. This could be on the first button, or on the left outside the stage, or anything.

To the buttons, add this code:

ActionScript:--------------------------------------

on(rollOver){  
\_root.tarX = this.instancenameofbutton.\_x  
}

* * *

There you go. You can also have the movieclip to change size smoothly (for example if one buttons is large and another is small), just ask and I’ll modify it

* * *

I woulda linked to the other post but I couldnt find it.

Cheers

---

<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:** [August 23, 2003, 2:34am UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/4 "2003-08-23T02:34:35Z")

</div>

hey, i don’t know if this one will help you, but maybe you can get a brainwave from it…

[http://www.kirupa.com/developer/mx/alpha\_fade.htm](http://www.kirupa.com/developer/mx/alpha_fade.htm)

it is quite a kewl effect.

---

<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:** [August 23, 2003, 7:59am UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/5 "2003-08-23T07:59:23Z")

</div>

Add this code to the movieclip that eases into position:

To onClipEvent(load)  
[AS]  
\_alpha = 50  
\_root.mccolor = new Color(this)[/AS]

To onClipEvent(enterFrame)  
[AS]  
\_root.mccolor.setTransform({ra:\_root.red, ga:\_root.green, ba:\_root.blue, aa:\_root.alpha});  
[/AS]

So the entire code would look like:  
[AS]  
onClipEvent(load){  
\_root.tarX = \_x  
\_root.tarW = \_width  
\_alpha = 50  
\_root.mccolor = new Color(this)  
}  
onClipEvent(enterFrame){  
\_x = \_root.tarX-(\_root.tarX-\_x)/1.2  
\_width = \_root.tarW-(\_root.tarW-\_width-5)/1.2  
\_root.mccolor.setTransform({ra:\_root.red, ga:\_root.green, ba:\_root.blue, aa:\_root.alpha});  
}[/AS]

Then, on your buttons, add this:

[AS] \_root.green = 100;  
\_root.blue = 0;  
\_root.red = 0;  
\_root.alpha = 50;[/AS]

If you’d want it to become green. 100 indicates the % of greenness. So the whole code of a button would be like:

[AS]on (release) {  
\_root.tarX = this.home.\_x;  
\_root.tarW = this.home.\_width+5;  
\_root.green = 100;  
\_root.blue = 0;  
\_root.red = 0;  
\_root.alpha = 50;  
}[/AS]

Hope that helps you 🙂

---

<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:** [August 24, 2003, 2:22pm UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/6 "2003-08-24T14:22:02Z")

</div>

Hello, thanks alot Voetsjoeba, I have it changing colour but what I meant was could it morph to another colour instead of a straight colour change, so it looks like a colour tween?

---

<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:** [August 24, 2003, 2:59pm UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/7 "2003-08-24T14:59:12Z")

</div>

Here ya go 🙂

MovieClip:[AS]  
onClipEvent (load) {  
\_root.tarX = \_x;  
\_root.tarW = \_width  
\_root.mColor = new Color(this);  
\_root.tarR = 100;  
\_root.tarG = 0;  
\_root.tarB = 0;  
\_root.tarA = 50;  
}  
onClipEvent (enterFrame) {  
//Properties  
\_x = \_root.tarX-(\_root.tarX-\_x)/1.2;  
\_width = \_root.tarW-(\_root.tarW-\_width)/1.2;  
//Colors  
curColor = \_root.mColor.getTransform();  
curra = curColor.ra;  
curga = curColor.ga;  
curba = curColor.ba;  
curaa = curColor.aa;  
\_root.mColor.setTransform({ra:\_root.tarR-(\_root.tarR-curra)/1.1, ga:\_root.tarG-(\_root.tarG-curga)/1.1, ba:\_root.tarB-(\_root.tarB-curba)/1.1, aa:\_root.tarA-(\_root.tarA-curaa)/1.1});  
}[/AS]

Buttons:[AS]  
on (release) {  
\_root.tarX = this.home.\_x;  
\_root.tarW = this.home.\_width+20;  
\_root.tarR = 0;  
\_root.tarG = 100;  
\_root.tarB = 0;  
\_root.tarA = 50;  
}[/AS]

😉

---

<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:** [August 24, 2003, 3:34pm UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/8 "2003-08-24T15:34:35Z")

</div>

Thats superb, thanks very much!🙂 :bounce:

---

<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:** [August 24, 2003, 3:37pm UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/9 "2003-08-24T15:37:29Z")

</div>

You’re welcome 🙂

---

<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:** [August 24, 2003, 5:01pm UTC](https://forum.kirupa.com/t/voetsjoebas-button-moveease-movie-clip/29155/10 "2003-08-24T17:01:58Z")

</div>

cool stuff voets. :thumb:
