This content has been marked as final. Show 6 replies
Take a look at Programming ActionScript 3.0 > Overview of ActionScript Programming > Display Programming in the Help files.
OK, I read the manual. What I came away with is the following line of code;
parentApplication.setChildIndex(parentApplication.getChildByName["modWardDetail"].pnlWardD etail, parentApplication.numChildren - 1);
By way of explanation, I am loading a module;
<mx:ModuleLoader id="modWardDetail" x="10" y="34" error="errorHandler(event)"/>
that contains the swf file that contains the above referenced line of code. When the parentApplication.setChildIndex... line of code is executed it generates the following error;
ReferenceError: Error #1069: Property modWardDetail not found on builtin.as$0.MethodClosure and there is no default value.
To debug I displayed all of the children using a loop with;
modWardDetail was in the list of children.
So where do I go from here?
BTW I get the same results with the line;
parentApplication.setChildIndex(parentApplication.getChildByName["modWardDetail"], parentApplication.numChildren - 1);
Surely it should be
parentApplication.setChildIndex(parentApplication.getChildByName("modWardDetail"), parentApplication.numChildren - 1);
Yes I should have used parenthethes, and not brackets.
Thanks for the hlp.
You wouldn't know how to get the name of the module that "this" is currently running in would you? My thought is to put this code at the parent and then I can call it passing the module.
The best way to find out these sort of things is to put a breakpoint in the code shortly after the module is created, run the debugger, then look through the variables listing to see if the module name shows up anywhere. If it does then you can access it exactly as it shows up in the listing.