Using print2flash with Tree Menu

Wtite here if you are not sure in which category to create your topic
Post Reply
drumax
Posts:5
Joined:Thu Nov 17, 2011 8:37 am
Using print2flash with Tree Menu

Post by drumax » Tue Nov 29, 2011 2:45 pm

I was wondering if you guys could help with a problem I am having. The code for embedding print2flash document works just fine but I have found that I have too many links and I need to use a Tree Menu to import the files and I am habing a hrd time incorporating the code as there are few example I can find that give examples on how to do this. The code I am using currently is the standard way:

stop();


import Print2Flash.*
import flash.display.Loader;
import flash.events.Event;
import flash.net.URLRequest;

stage.scaleMode=StageScaleMode.NO_SCALE
stage.align=StageAlign.TOP_LEFT

btn_one.addEventListener(MouseEvent.CLICK, clickHandler);

var P2FDocLoader:Print2FlashDoc3;

function clickHandler(e:Event):void{

switch(e.target.name){
case "btn_one": P2FDocLoader=new Print2FlashDoc3("modules/01.swf",375,115,570,521,this); break;
}
}

I now need to accomplish the same thing but with a tree menu like Astra. The code for the tree menu is as follows:


stop();
import com.microwebber.tree.*;
import Print2Flash.*
import flash.display.Loader;
import flash.events.Event;
import flash.net.URLRequest;

stage.scaleMode=StageScaleMode.NO_SCALE
stage.align=StageAlign.TOP_LEFT

mytree.setSize(310,417);
var usingFolderIcons = false;
function switchIcons(e){
usingFolderIcons = !usingFolderIcons;
mytree.setDefaultFolderStyle(usingFolderIcons);
mytree.invalidate();

}

//mytree.setHorizontalPolicy(true,true);

var dp:XML =
<node>
<node label="Node Overview">
</node>
<node label="Node 1">
<node label="information"/>
</node>
</node>;

mytree.setRendererStyle("nodeIndent", 20);

mytree.addXML(dp);

Would you guys be able to aid me in how I would incorporate your code for pulling in print2flash files with the Tree menu code so I can use it to pull in swf files? The only examples I can find it the menu pulling in Movie Clips and I can seem to figure out how I would use the p2fDocLoader with this menu...any help would be greatly appreciated.

staff
Posts:267
Joined:Sat Dec 15, 2007 4:48 pm

Re: Using print2flash with Tree Menu

Post by staff » Tue Nov 29, 2011 3:34 pm

You need to execute the code like this after a menu item is selected:

Code: Select all

P2FDocLoader=new Print2FlashDoc3(docurl,375,115,570,521,this);
If you have a sample where a regular SWF file is loaded when an item is clicked, you just need to replace the code in that sample that loads the SWF file with the above code.
If you still experience problems after you tried this, could you send your problem project to our support e-mail so that we can investigate it?

staff
Posts:267
Joined:Sat Dec 15, 2007 4:48 pm

Re: Using print2flash with Tree Menu

Post by staff » Tue Nov 29, 2011 8:21 pm

We received your project, fixed it and sent it back. You just needed to hook a click event listener to your tree and load a Print2Flash document with the above code in the event handler.

Post Reply