[quote=snickelfritz;2349795]my 2¢, based on 6 months of experience with AS3.
Somebody please correct me if I’m mistaken.
[COLOR=Blue]MOUSE_OVER[/COLOR] will issue new rollover events for each child of a display object container containing multiple children. (ie: multiple buttons nested within a single container)
[COLOR=blue]ROLL_OVER[/COLOR] will issue only a single rollover event, regardless of the presence of multiple children within a display object container.
This essentially bypasses the advantages/(or defects, depending on your construction methods) of AS3 event propagation.
This might be useful for mitigating UI construction issues, with regard to default AS3 display list behaviors, but will probably require separate listeners for each button instance.
ie: 30 buttons would require 30 event listeners.
As far as I can see, this is essentially just a “kludge” that causes AS3 to act more like AS2.
For example:
Attaching a [COLOR=blue]MOUSE_OVER[/COLOR] event listener to “buttonGroup” will register new rollover events for each of the children of buttonGroup.
ActionScript Code:
[LEFT]buttonGroup.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]MOUSE_OVER[/COLOR], btnOver, [COLOR=#000000]false[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000000]true[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]//limit mouse events to children only, and enable hand-cursor[/COLOR]
buttonGroup.[COLOR=#000080]mouseEnabled[/COLOR] = [COLOR=#000000]false[/COLOR].
[COLOR=#000080]buttonGroup[/COLOR].[COLOR=#000080]buttonMode[/COLOR] = [COLOR=#000000]true[/COLOR].
[/LEFT]
This allows a single listener to serve multiple nested children of the attached display object container.
ie: you construct your button movieclips; name the instances; wrap them in the “buttonGroup” container; attach a set of [COLOR=blue]MOUSE_OVER[/COLOR]/[COLOR=blue]MOUSE_OUT[/COLOR]/[COLOR=blue]MOUSE_DOWN[/COLOR] etc… listeners to “buttonGroup”.
This is a good thing, and leverages AS3 event propagation to its fullest potential.
With regard to the OP issue, the problem is rooted in your construction methods, IMO.
Using a Tweening class for button over/out tweens is easier to implement and far more flexible.
TweenLite/TweenMax, Tweener, or the built-in Tween class can be utilized to dramatically simplify your project.
ie: ActionScript Code:
[LEFT][COLOR=#000000]function[/COLOR] btnOverCOLOR=#000000[/COLOR]:[COLOR=#0000FF]void[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#808080]//tween class methods here.[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/quote]
i haven’t studied the twining class yet…but i could suggest that instead of that one, to avoid writing 30 different eventListeners to 30 different buttons, you can just put the m into an array and write the code once… the more arrays you use, the better your project will be…
i did have the same problems, when the mouse was over the button, some text (child of the button) had to go on it too, and the crash was incredible. nor ROLL_OVER could help me instead of MOUSE_OVER!
But i could solve it using a combination of MOUSE_OVER and mouseEnabled=false on the text.
i started 3 months ago with AS3, never used flash and AS before, but i find AS3 simply fantastic…