# Using two Loaders for one Tree Menu

**URL:** <https://forum.kirupa.com/t/using-two-loaders-for-one-tree-menu/330571>\
**Category:** flash\
**Created:** [February 11, 2013, 2:51pm UTC](https://forum.kirupa.com/t/using-two-loaders-for-one-tree-menu/330571 "2013-02-11T14:51:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DruMAX](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@DruMAX](https://forum.kirupa.com/u/DruMAX)\
**Post date:** [February 11, 2013, 2:51pm UTC](https://forum.kirupa.com/t/using-two-loaders-for-one-tree-menu/330571/1 "2013-02-11T14:51:03Z")

</div>

[SIZE=2]I am using a tree menu that I am loading in Print2Flash documents. There is one node on the menu I want to load a regular SWF file that will have links to animations. Because my loader is customized to load Print2Flash documents, is there a way to use a new loader to load a standard SWF on one of the Tree Menu Nodes?[/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]I tried to put in a new loader but so far no luck, I am getting _‘Incorrect number of argument. Expected no more than 1’_ on the case line for the new loader.[/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]Code is below…my attempt to put in a new loader is bolded…any help?[/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]stop();  
import com.microwebber.tree._;  
import Print2Flash._  
import flash.display.Loader;  
import flash.events.Event;  
import flash.net.URLRequest;  
import fl.events.\*;[/SIZE]  
[SIZE=2]  
stage.align=StageAlign.TOP\_LEFT[/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]mytree.setSize(315,417);  
var usingFolderIcons = false;  
function switchIcons(e){  
usingFolderIcons = !usingFolderIcons;  
mytree.setDefaultFolderStyle(usingFolderIcons);  
mytree.invalidate();  
}

[//mytree.setHorizontalPolicy](https://mytree.setHorizontalPolicy)(true,true);[/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]var dp:XML =  
\<node\>  
\<node label="LS-15 Liner Hanger Packer Overview "\>  
\</node\>  
\<node label="Module Course Content "\>  
\<node label="Pre-Operational Procedures "/\>  
\<node label="Running Procedures: Quick Glance "/\>  
\<node label="Detailed Running Procedures "/\>  
\<node label="Post Operational Procedures "/\>  
\<node label="Animations "/\>  
\</node\>  
\<node label="Testing Your Knowledge of this Module "\>  
\</node\>  
\</node\>;[/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]mytree.setRendererStyle(“nodeIndent”, 20);[/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]mytree.addXML(dp);[/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]btnClose2.addEventListener(MouseEvent.CLICK, bigborecontent);  
function bigborecontent(myevent:MouseEvent):void {  
MovieClip(parent.parent).removeF();  
}[/SIZE]  
[SIZE=2]  
var P2FDocLoader:Print2FlashDoc3; [/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]mytree.addEventListener(ListEvent.ITEM\_CLICK, handleClick);  
function handleClick (ev:ListEvent) : void {  
switch(ev.item.label) {  
case "LS-15 Liner Hanger Packer Overview ":  
P2FDocLoader=new Print2FlashDoc3(“modules/overview.swf”,375,115,575,550,this);  
break;  
case "Pre-Operational Procedures ":  
P2FDocLoader=new Print2FlashDoc3(“modules/LSpreoperational.swf”,375,115,575,550,this);  
break;  
case "Running Procedures: Quick Glance ":  
P2FDocLoader=new Print2FlashDoc3(“modules/LSrunningproceduresquickglace.swf”,375,115,575,550,this);  
break;  
case "Detailed Running Procedures ":  
P2FDocLoader=new Print2FlashDoc3(“modules/LSrunningproceduresdetailed.swf”,375,115,575,550,this);  
break;  
case "Post Operational Procedures ":  
P2FDocLoader=new Print2FlashDoc3(“modules/LSpostoperational.swf”,375,115,575,550,this);  
break;  
case "Testing Your Knowledge of this Module ":  
P2FDocLoader=new Print2FlashDoc3(“modules/testing.swf”,375,115,575,550,this);  
break;  
}  
} [/SIZE]  
[SIZE=2] [/SIZE]  
[SIZE=2]**var loader:Loader = new Loader();**  
**addChild(loader);**[/SIZE]  
[SIZE=2]**mytree.addEventListener(ListEvent.ITEM\_CLICK, handleClick1); \*\*  
 function handleClick1 (ev:ListEvent) : void { \*\*  
\*\* switch(ev.item.label) {  
\*\* case "Animations ":**  
\*\* loader.load(new URLRequest(“modules/LSpostoperational.swf”,375,115,575,550,this));\*\*  
\*\* break;\*\*  
\*\* }\*\*  
\*\*} \*\*[/SIZE]
