HI All…
following scenario:
I add an mc as a container stick another mc inside for the navigation bar
and place a “button” mc inside that.
so:
root1 [object WB_X]
NaviBox [object MovieClip]
Navi [object Helm_mc]
[object Shape]
Home [object Btn_1]
[object Shape]
NaviBox: listens for MOUSE_OVER, on which Navibox and all content moves.
Navi: is just pretty but has no real purpose in this…
Home: is the “button” listening for MOUSE_UP
all dandy… NOT!?
NaviBox responds to MOUSE_OVER fine and does its thing, BUT
as soon as you MOUSE_OVER the Home “Button” it triggers the tween to reverse
NaviBox.
I’ve tried all different nesting orders I could think of
and tried all parameters for the addEventListener and lots of other nasty things
that are too private to elaborate in public,
I am not getting ANYWHERE and frankly… my brain hurts.
please can some one put me out of my misery?
Code here:
/////////////////////////////////////////////////////////////////////
package {
import flash.display.*;
import flash.events.*;
import flash.ui.Keyboard;
import fl.transitions.*;
import fl.transitions.easing.*;
public class WB_X extends MovieClip {
public function WB_X() {
var NavCon:MovieClip = new MovieClip();
NavCon.name = "NaviBox"
addChildAt(NavCon, 0);
var Helm:MovieClip = new Helm_mc;
Helm.name = "Navi";
NavCon.addChildAt(Helm, 0);
Helm.x = 20;
Helm.y = 20;
var STGE:MovieClip = new BG_mc;
STGE.name = "BG_cont";
addChildAt(STGE, 0);
var BtnOne:MovieClip = new Btn_1;
BtnOne.name = "Home"
Helm.addChildAt(BtnOne,1);
BtnOne.x = -150;
BtnOne.y = 10;
NavCon.addEventListener(MouseEvent.MOUSE_OVER, helmover, false, 0, true);
NavCon.addEventListener(MouseEvent.MOUSE_OUT, helmout, false, 0, true);
BtnOne.addEventListener(MouseEvent.CLICK, CLICKED, false, 0, true);
var starton:Number = Helm.x;
var stopon:Number = 690;
var stopon2:Number = 20;
var dur:Number = 1;
//var helmer:Tween = new Tween(Helm, "x", Bounce.easeOut, starton, stopon, dur, true);
function helmover() :void {
NavCon.removeEventListener(MouseEvent.MOUSE_OVER, helmover);
new Tween(NavCon, "x", Bounce.easeOut, starton, stopon, dur, true);
starton = 690;
}
function helmout() :void {
NavCon.addEventListener(MouseEvent.MOUSE_OVER, helmover);
new Tween(NavCon, "x", Bounce.easeOut, starton, stopon2, dur, true);
starton = 20;
}
function CLICKED() :void {
trace("I HAVE FINALY BEEN CLICKED!!");
}
//TRACES DISPLAY LIST AND SORTS RESULTS WITH INDENTS//VVVVVVVVVVVVVVVVVVVVVVVVV
function showChildren(dispObj:DisplayObject, indentLevel:Number):void {
for (var i:int = 0; i < dispObj.numChildren; i++) {
var obj:DisplayObject = dispObj.getChildAt(i);
if (obj is DisplayObjectContainer) {
trace(padIndent(indentLevel),obj.name, obj);
showChildren(obj, indentLevel + 1);
} else {
trace(padIndent(indentLevel) + obj);
}
}
}
showChildren(stage, 0);
function padIndent(indents:int):String {
var indent:String = "";
for (var i:Number = 0; i < indents; i++) {
indent += " ";
}
return indent;
}
////////////////////////////////////////////
}
}
}
Any input will be greatfully received.
Lexic13