Loading Print2Flash SWF Files On MouseEvent
Posted: Sat Nov 19, 2011 10:54 pm
Hello, I am trying to import print2flash swf files into a project that previously was using regular SWF files. The code I use for this is below. Now I know the code you offer to embed P2F SWF file will bring them in with the abilty to size and position them them exactly how you need them and it works when you enter the frame. I posted the code I assume I need to incorporate these P2F files below my existing code. Can anyone advise me just how one would marry this code to import these P2F SWF files in the same way? I am sorry...I have tried for some time but I am probably just missing something. Others might benefit from this as well.
stop();
btn1.addEventListener(MouseEvent.CLICK, clickHandler);
btn2.addEventListener(MouseEvent.CLICK, clickHandler);
var loader:Loader = new Loader();
addChild(loader);
function clickHandler(e:Event):void{
switch(e.target.name){
case "btn1": loader.load(new URLRequest("exampleA.swf")); break;
case "btn2": loader.load(new URLRequest("exampleB.swf")); break;
}
}
----------------------------------------------------------------------------------------------------------
Print2Flash code from this site:
import Print2Flash.*
stage.scaleMode=StageScaleMode.NO_SCALE
stage.align=StageAlign.TOP_LEFT
var P2FDocLoader:Print2FlashDoc3=new Print2FlashDoc3("modules/FlashDoc.swf",300,120,650,520,this)
P2FDocLoader.addEventListener(Print2FlashDoc3.ONLOADEVENT, OnLoaded);
var P2FDoc:MovieClip
var totalPages:Number=0
function OnLoaded(e:Event) {
P2FDoc=P2FDocLoader.getDoc()
}
If someone could give me a bit of assistance in this problem I am having I would appreciate it. These P2F capabilities are exactly what we need but for the life of me I cant get this to work.
Thanks
stop();
btn1.addEventListener(MouseEvent.CLICK, clickHandler);
btn2.addEventListener(MouseEvent.CLICK, clickHandler);
var loader:Loader = new Loader();
addChild(loader);
function clickHandler(e:Event):void{
switch(e.target.name){
case "btn1": loader.load(new URLRequest("exampleA.swf")); break;
case "btn2": loader.load(new URLRequest("exampleB.swf")); break;
}
}
----------------------------------------------------------------------------------------------------------
Print2Flash code from this site:
import Print2Flash.*
stage.scaleMode=StageScaleMode.NO_SCALE
stage.align=StageAlign.TOP_LEFT
var P2FDocLoader:Print2FlashDoc3=new Print2FlashDoc3("modules/FlashDoc.swf",300,120,650,520,this)
P2FDocLoader.addEventListener(Print2FlashDoc3.ONLOADEVENT, OnLoaded);
var P2FDoc:MovieClip
var totalPages:Number=0
function OnLoaded(e:Event) {
P2FDoc=P2FDocLoader.getDoc()
}
If someone could give me a bit of assistance in this problem I am having I would appreciate it. These P2F capabilities are exactly what we need but for the life of me I cant get this to work.
Thanks