viewstack causing error 1065 variable not defined issue?

Posted by jason on Stack Overflow See other posts from Stack Overflow or by jason
Published on 2010-04-09T20:09:00Z Indexed on 2010/04/09 20:13 UTC
Read the original article Hit count: 400

Filed under:
|
|
|

I've got an flex application where I have a left side TREE control and a viewstack on the right and when someone selects the tree it loads the named viewstack based on the hidden node value of the XML of the tree. But it's throwing a error 1065 variable not defined on a viewstack which worked on the last browser refresh/reload. It's not related to a particular viewstack from what I can tell it just seems to throw the error on certain render events. I've tried to use creationpolicy="all" on the viewstack but it seems to not be of any help.

public function treeChanged(event:Event):void {

            selectedNode=Tree(event.target).selectedItem as XML;
            //trace(selectedNode.@hidden);
            //Alert.show([email protected]() + " *");

            if([email protected]() == '' || [email protected]() == null){
                //Alert.show("NULL !");
                return;
            }


            mainviewstack.selectedChild = Container(mainviewstack.getChildByName([email protected]())); //Container(mainviewstack.getChildByName(selectedNode.@hidden));

If I add in an alert box before the getchildbyname option the viewstack has time to render and everything works fine, so it leads me to believe the app is not giving it enough time to load the viewstack?

© Stack Overflow or respective owner

Related posts about flex3

Related posts about flex