# SimpleButton, is it possible to change states?

**URL:** https://forum.kirupa.com/t/simplebutton-is-it-possible-to-change-states/231417
**Category:** Uncategorized
**Created:** [July 4, 2007, 4:04pm UTC](https://forum.kirupa.com/t/simplebutton-is-it-possible-to-change-states/231417 "2007-07-04T16:04:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![plog](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@plog](https://forum.kirupa.com/u/plog)
#### Post date: [July 4, 2007, 4:04pm UTC](https://forum.kirupa.com/t/simplebutton-is-it-possible-to-change-states/231417/1 "2007-07-04T16:04:16Z")

</div>

Hi there,  
i’ve created two buttons. let’s say:  
var a:SimpleButton = new SimpleButton();  
var b:SimpleButton = new SimpleButton();

// defining states.  
a.upState = …  
a.downState = …  
bla bla…  
…

## so i placed these buttons on the stage and wanna that they follow each other states. if I, roll over on button B, the button A, should change state to overState. if I, roll out off button B, the button A, should change to default state.

I tried to solve this problem, like this:  
function over\_handler(e:MouseEvent) {  
var forward:MouseEvent = new MouseEvent(MouseEvent.ROLL\_OVER);  
a.dispatchEvent(forward);  
}  
B.addEventListener(over\_handler);

- (tried MOUSE\_OVER too…)  
but no visual changes… 😕  
i thought that i dispatching event incorrectly.  
but added EventListener to button A. i saw that i really got the ROLL\_OVER event.

so, why the button state doesn’t change visually ?☹  
(is the button state changing by Flash before the Event’s occur?)  
Please explain me why my events is ignored by SimpleButton ☹  
How could I change the state in AS3 ? 🙂  
thanks.
