So I reworked my code and it seems more clear but who always get "RangeError: Error #2006: the supplied index is out of bounds"nonsense. " (CODE + ERROR ATTACHED)

I reworked the code to make it without error. now, all we are dealing with is the problem of ERROR REANGE. I'm very new to Flash and read responses from people on sites where they solved this problem, but do not understand what people at all. any help would be greatly appreciated.

Let me explain a little better my problem: I am creating a menu drop-down. everything goes fine UNTIL I'll scroll above the button and get the error. I added an inner glow, etc and it all works very well. I'm only stuck to where the menu is supposed to go down.

CODE 1:

var navBtnGlow:GlowFilter = new GlowFilter (0 x 000000, 0.5, 0, 15, 1, 2, true, false);

navBar_mc.addEventListener (MouseEvent.MOUSE_OVER, navOverF);

navBar_mc.addEventListener (MouseEvent.MOUSE_OUT, navOutF);

function navOverF(event:MouseEvent):void {}

event.target.filters = [navBtnGlow];

navBar_mc.setChildIndex (event.target as MovieClip, 1);

dropMenus_mc.gotoAndStop (navBar_mc.getChildAt (1) .name);

trace ("we rolled on..." + navBar_mc.getChildAt (1) .name)

}

function navOutF(event:MouseEvent):void {}

event.target.filters = [];

}

ERROR:

RangeError: Error #2006: the supplied index is out of range.

at flash.display::DisplayObjectContainer/setChildIndex()

to NEWprim_fla::MainTimeline/navOverF()

Thank you for your help in advance.

not sure about this, but what happens if you change your setchildindex to 0? in the navOverF function

Tags: Adobe Animate

Similar Questions

Maybe you are looking for