Something like...
((Its been a while since I looked at the printing stuff, but this should
give you a head start))
private function print(comp: UIComponent) :void
{
var Printbutton: FlexPrintJob = new FlexPrintJob( );
var printConfirmed: Boolean = Printbutton. start();
if(printConfirmed)
{
Printbutton. addObject(comp);
Printbutton. send();
}
}
<mx:Panel id="PanelTest001" >
</mx:Panel>
<mx:Button label="print" click="print(PanelTest001)"/>
<mx:Panel id="PanelTest002" />
</mx:Panel>
<mx:Button label="print" click="print(PanelTest002)"/>
Gk.
Gregor Kiddie
Senior Developer
INPS
Tel: 01382 564343
Registered address: The Bread Factory, 1a Broughton Street, London SW8
3QJ
Registered Number: 1788577
Registered in the UK
Visit our Internet Web site at www.inps.co.uk
<blocked::http://www.inps.co.uk/>
The information in this internet email is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is not authorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
INPS or any of its affiliates. If you are not the intended recipient
please contact [EMAIL PROTECTED]
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of sailorsea21
Sent: 13 November 2008 14:45
To: [email protected]
Subject: [flexcoders] Re: If I have 2 panels, each with their own print
buttons, can I have one function?
Printbutton. addObject(event.Target. ???);
How do I target the panels?
I would like each button to target their panel using the same
function...
Thanks.
private function print(event: MouseEvent) :void
{
var Printbutton: FlexPrintJob = new FlexPrintJob( );
var printConfirmed: Boolean = Printbutton. start();
if(printConfirmed)
{
Printbutton. addObject(event.Target. ???);
Printbutton. send();
}
}
<mx:Panel id="PanelTest001" >
</mx:Panel>
<mx:Button label="print" click="print( event)"/>
<mx:Panel id="PanelTest002" />
</mx:Panel>
<mx:Button label="print" click="print( event)"/>
--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Gregor Kiddie" <[EMAIL PROTECTED]>
wrote:
>
> The code you wrote was pretty much spot on... are there any other
> requirements you didn't mention?
>
>
>
> Gregor Kiddie
> Senior Developer
> INPS
>
> Tel: 01382 564343
>
> Registered address: The Bread Factory, 1a Broughton Street, London
SW8
> 3QJ
>
> Registered Number: 1788577
>
> Registered in the UK
>
> Visit our Internet Web site at www.inps.co.uk
> <blocked::http://www.inps.co.uk/ <http://www.inps.co.uk/> >
>
> The information in this internet email is confidential and is
intended
> solely for the addressee. Access, copying or re-use of information
in it
> by anyone else is not authorised. Any views or opinions presented
are
> solely those of the author and do not necessarily represent those of
> INPS or any of its affiliates. If you are not the intended recipient
> please contact [EMAIL PROTECTED]
>