Hello everyone,
I have several panels. They each have a print and a save button.
Is it possible to have only one function to target the panel from the
buttons?
Here's my code:
private function print(event:MouseEvent):void
{
var Printbutton:FlexPrintJob = new FlexPrintJob();
var printConfirmed:Boolean = Printbutton.start();
if(printConfirmed)
{
Printbutton.addObject((event.target.id)+"_b");
Printbutton.send();
}
}
private function save(event:MouseEvent):void
{
convertToImage(((event.target.id)+"P_b"), new JPEGEncoder(100));
}
<mx:Panel id="Panel001_SP_b"/>
<mx:Button id="Panel001_S" label="print" click="print(event)"/>
<mx:Button id="Panel001_SP" label="save" click="save(event)"/>
<mx:Panel id="Panel002_SP_b"/>
<mx:Button id="Panel002_S" label="print" click="print(event)"/>
<mx:Button id="Panel002_SP" label="save" click="save(event)"/>
<mx:Panel id="Panel003_SP_b"/>
<mx:Button id="Panel003_S" label="print" click="print(event)"/>
<mx:Button id="Panel003_SP" label="save" click="save(event)"/>
Thanks!
-David