Hi,
I have a set of buttons which trigger menu panels to tween up from below the screen. I want these menu panels to be displayed behind the buttons (which are displayed on the button edge of the screen). So I add the menus to the parent container, then I add the buttons, so that the menus would be behind the buttons and getChildIndex(buttons) = 1 and getChildIndex(menus) = 0.
The menus are correctly displayed behind the buttons when I comment out the tween code. But when I implement the tweens and start the tween of the menus, they do their motion tween but are displayed in front of the buttons instead of behind; somehow their display object index order got screwed up.
Some very simplified code:
from the Menu class:
[COLOR=#993300]this[/COLOR].[COLOR=#000000]tweenIn[/COLOR] = [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR][COLOR=#993300]this[/COLOR], [COLOR=#0000ff]"y"[/COLOR], Regular.[COLOR=#000000]easeOut[/COLOR], stageHeight, stageHeight - [COLOR=#993300]this[/COLOR].[COLOR=#993300]height[/COLOR], [COLOR=#000000]2[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]this[/COLOR].[COLOR=#000000]tweenOut[/COLOR] = [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR][COLOR=#993300]this[/COLOR], [COLOR=#0000ff]"y"[/COLOR], Regular.[COLOR=#000000]easeOut[/COLOR], stageHeight - [COLOR=#993300]this[/COLOR].[COLOR=#993300]height[/COLOR], stageHeight, [COLOR=#000000]2[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
tweenIn.[COLOR=#993300]stop[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
tweenOut.[COLOR=#993300]stop[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
From Button class:
[LEFT][COLOR=#993300]this[/COLOR].[COLOR=#000000]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000000]CLICK[/COLOR], startTween[COLOR=#000000])[/COLOR];
[COLOR=#993300]function[/COLOR] startTween[COLOR=#000000]([/COLOR][COLOR=#993300]e[/COLOR]:MouseEvent[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
myMenu.[COLOR=#000000]tweenIn[/COLOR].[COLOR=#993300]start[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
Is this a known issue? Any workarounds?
Thanks a lot,
Jeremy