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.