Error #2007:?

I’ve seen this error posted a lot, but never a real explanation on what causes it.

Here is my code:

                    var warning:JAlert = new JAlert();
                    addChildAt(greyout, numChildren - 1);
                    addChildAt(warning, numChildren - 1);
                    warning.SetHeaderColors(0xff0000);
                    warning.EditAlert("WARNING - New Project",
                                      "Starting a New Project will erase all current data (Nodes and Map).  
Are you sure?",
                                      "OK","CANCEL");
                    warning.addEventListener("ALERT_BUTTON", WarningButtonHandler);

[COLOR=Black]
The error is on the last line when I go to make the event listener. My best guest would be that the listener is trying to be created before the object (warning) is finished being created?

If I am correct, what would be the best way to get around that (without having to make a timer, I could do that but it seems like overkill). If I am wrong, then what could be the issue. If I take away that line, all is well…

[/COLOR]