# Using animation function with buttons

**URL:** <https://forum.kirupa.com/t/using-animation-function-with-buttons/262959>\
**Category:** Uncategorized\
**Created:** [June 11, 2008, 12:55pm UTC](https://forum.kirupa.com/t/using-animation-function-with-buttons/262959 "2008-06-11T12:55:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mesilane](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mesilane](https://forum.kirupa.com/u/Mesilane)\
**Post date:** [June 11, 2008, 12:55pm UTC](https://forum.kirupa.com/t/using-animation-function-with-buttons/262959/1 "2008-06-11T12:55:27Z")

</div>

Hey!

What I’d like to create is a menu. Let’s say, menu has 4 buttons. But instead of creating each a animation (which is the same for all of them) I’d like to create an animation function and use the function with the buttons. The question is how to create such function and integrate it with buttons. The animation function should contain onRollOver and onRollOut functions too for start. For animations I will use AS 2.0. mx.transitions.Tween.

All kind of help is awaited.

Thank You in advance

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 11, 2008, 1:16pm UTC](https://forum.kirupa.com/t/using-animation-function-with-buttons/262959/2 "2008-06-11T13:16:20Z")

</div>

search the forums this topic has come up 5 times in the last 3 days

hint: for loop, numbered buttons

---

<div class="post-metadata">

**Author:** ![snickelfritz](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@snickelfritz](https://forum.kirupa.com/u/snickelfritz)\
**Post date:** [June 11, 2008, 2:34pm UTC](https://forum.kirupa.com/t/using-animation-function-with-buttons/262959/3 "2008-06-11T14:34:12Z")

</div>

Install TweenMax.
