I have two independent .swfs in the same file directory image.swf and button.swf
When a button in button.swf is click I want to print the contents of image.swf (Which will be loaded)
The code I need combines, local connection() and PrintJob().
I need help with the code I have so far as I am not a programmer, please do not laugh if it is simple please supply fixed code:
Sending .swf in this case Print_Button.swf:
**// Code in the sending SWF file
var sending_lc:LocalConnection = new LocalConnection();
// When someone hits the arcade button…call a function?
print_mc.onRelease = function() {
// Need to call a function that passes some parameter to the receiving swf ???..this is where I get stuck (Example below is for the text example we need to change)
sending_lc.send(“lc_name”, “methodToExecute”, this.text);
};**
Receiving .swf in this case Need2Print.swf:
**// Code in the receiving SWF file
// create the local connection in the receiving file
var receiving_lc:LocalConnection = new LocalConnection();
// define the function that is going to be triggered by the other movie (sending file //print_button.swf)
//This part needs to be changed to receive the function from print_button.swf…Again I //have no idea:
receiving_lc.methodToExecute = function(t:String){
// Print Something !!!
var my_pj = new PrintJob();
var myResult = my_pj.start();
if (myResult) { myResult = my_pj.addPage("_root", {xMin:13, xMax:535, yMin:20, yMax:373}, {printAsBitmap:true}, 1);
my_pj.send();
my_pj.orientation == "landscape";
delete my_pj;
}
};
receiving_lc.connect(“lc_name”);
**