# \[FMX\] Same behavior for different objects?

**URL:** <https://forum.kirupa.com/t/fmx-same-behavior-for-different-objects/114889>\
**Category:** Uncategorized\
**Created:** [July 2, 2004, 7:15pm UTC](https://forum.kirupa.com/t/fmx-same-behavior-for-different-objects/114889 "2004-07-02T19:15:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Froggy](https://avatars.discourse-cdn.com/v4/letter/f/58956e/32.png) [@Froggy](https://forum.kirupa.com/u/Froggy)\
**Post date:** [July 2, 2004, 7:15pm UTC](https://forum.kirupa.com/t/fmx-same-behavior-for-different-objects/114889/1 "2004-07-02T19:15:10Z")

</div>

[font=Fixedsys][font=Times New Roman][size=3]Hello!

I have a problem and I hope that u can help me out. The thing is that I’m going to have several buttons on my page but I want them all to have the same animation or behavior when clicked on. Is it possible to use variables to label objects?  
[/size][/font][font=Times New Roman][size=3]  
[/size][/font][font=Times New Roman][size=3]Would really appreciate if someone could help me out![/size][/font][font=Times New Roman][size=3]

[/size][/font][font=Times New Roman][size=3]Lets imagine that I have button named home and another one labeled about. And then I have a variable named buttonName that changes when you put ur mouse over a button.[/size][/font]  
[font=Courier New]  
home.onRollOver = function(){  
buttonName = “home”;  
URL = “[http://www.google.com](http://www.google.com)”;  
};

```
 home.onRollOut = function(){
     buttonName = "";
     URL = "";
 };

```

[/font] [/font][font=Courier New]about.onRollOver = function(){  
buttonName = “about”;  
URL = “[http://www.av.com](http://www.av.com)”;  
};

about.onRollOut = function(){  
buttonName = “”;  
URL = “”;  
};  
[/font][font=Fixedsys][font=Courier New]  
[/font] [font=Courier New][color=Red]buttonName[/color][/font][font=Courier New].onRelease = function(){  
getURL(URL, \_blank);  
};[/font]

[font=Times New Roman][size=3]I hope you understand the problem…  
Thanks![/size][/font][/font]

---

<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:** [July 3, 2004, 9:04am UTC](https://forum.kirupa.com/t/fmx-same-behavior-for-different-objects/114889/2 "2004-07-03T09:04:46Z")

</div>

[variable].onRelease = function(){…
