I'm writing a flex program in an OO manner and I've got to the point of creating a ViewStack to hold various panels. My problem is that when I add a panel to the ViewStack it throws the aforementioned error. No doubt the answer is pretty obvious so here's the constructor for the manager class that holds my ViewStack.
stack = new ViewStack();
loginPanel = new LoginPanel;
regPanel = new RegisterPanel;
stack.creationPolicy = "all";
stack.addChild(loginPanel);
stack.currentState = "loginPanel";