1
votes

I have created a flash document and i get this error

TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/setChildIndex() at VersiontwoFlashwebsite_fla::MainTimeline/navOverF()

I do not fully understand it so any help would be great... here is the code in which i believe the error is held...

import flash.filters.GlowFilter;
import flash.events.MouseEvent;
import flash.display.MovieClip;


var navBtnGlow:GlowFilter = new GlowFilter(0x999999,0.5,0,15,1,2,true,false);
mc_navbar.addEventListener(MouseEvent.MOUSE_OVER, navOverF);
mc_navbar.addEventListener(MouseEvent.MOUSE_OUT, navOutF);
function navOverF(event:MouseEvent):void
{
    event.target.filters = [navBtnGlow];
    mc_navbar.setChildIndex(event.target as MovieClip, 1);
    dropdown.gotoAndStop(mc_navbar.getChildAt(1).name);

}
function navOutF(event:MouseEvent):void
{
    event.target.filters = [];
}
1

1 Answers

1
votes

It looks like it's throwing an error at

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

Because event.target isn't a child of mc_navbar

You might want to use your debugger to check what event.target is referring to and make sure it's what you think it is.