# \[FMX\] Buttons and Custom classes

**URL:** <https://forum.kirupa.com/t/fmx-buttons-and-custom-classes/164234>\
**Category:** flash\
**Created:** [September 29, 2005, 2:11pm UTC](https://forum.kirupa.com/t/fmx-buttons-and-custom-classes/164234 "2005-09-29T14:11:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damask](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@Damask](https://forum.kirupa.com/u/Damask)\
**Post date:** [September 29, 2005, 2:11pm UTC](https://forum.kirupa.com/t/fmx-buttons-and-custom-classes/164234/1 "2005-09-29T14:11:16Z")

</div>

[font=&quot]Hey everyone!

I’m a new member to the forums with an annoying Flash problem. I was wondering if you people could help me out?

Basically I’m trying to get a button to change color via a Custom class written in ActionScript. I have built and attached an example to show you all what I’m trying to achieve. The code works perfectly with a MovieClip, but when I try to apply it to a Button, it falls flat (can’t even find the reference to the button it seems).

On my stage are two objects:

1. A Movie Clip
2. A Button

These are both set to “Export for ActionScript”, and have an attached class called ‘ColorClass’. ColorClass is basically what does all the work (makes a Color object, and has set and get methods). I also have an action layer where all my other code is contained.

I’m fairly new to ActionScript, but come from a Java background, so know a bit about code 😛 Hopefully this is a simple problem where I just overlooked something obvious!

Thanks in advance,  
Damask[/font]
