Using print2flash with Tree Menu
Posted: 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.
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.