Hi Rich,

Try this....



##PrinJobExample.mxml###

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"; xmlns="*">

        <mx:Script>
                <![CDATA[
  
            import Help;
           
            var helpRef;
            
            public function testPrintJob():Void 
            {                   
                helpRef= createChild(Help, "help");

                        //wait untill help is created & rendered
completely...
                helpRef.addEventListener("creationComplete",
mx.utils.Delegate.create(this, printHelp));
             }
            
            function printHelp()
            {
                 var printJob:PrintJob= new PrintJob();
                 printJob.start();
                 printJob.addPage(helpRef);
                 
                 printJob.send();
                 delete printJob;
                 destroyChild(helpRef);
            }   
    ]]>
        </mx:Script>
        
        <mx:Button label="print" click="testPrintJob();"/>

</mx:Application>


##Help.mxml###

<mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml";>
    <mx:Label id="_lbl" text="Hello I am Help...."/>
    <mx:Button label="Button in Help..."/>
</mx:VBox>



Hope that helps...


-abdul

-----Original Message-----
From: Rich Tretola [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 01, 2005 5:43 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: PrintJob()


Does anyone have any ideas about this ?



On Mar 31, 2005 3:06 PM, Rich Tretola <[EMAIL PROTECTED]> wrote:
> I am trying to print an mlmx file at the same level as the one calling
> the printjob.  Here is my code:
> public function testPrintJob():Void {
>         var printJob:PrintJob = new PrintJob();
>         var help:Help = new Help();
>         mx.core.Application.alert("testProperty :" + help.testProperty);
>         printJob.start();
>         printJob.addPage(0);
>         printJob.addPage("help");
>         printJob.send();
>         delete printJob;
> }
> 
> Help.mxml is the object being created in the 2nd lineof the method and
> it is being created correctly as I can read the properties of the file
> through an alert on the next line, bit I am only getting the 1st page
> which is using 0 as the object path (_root).  I have tried using help
> with and without the quotes and can never get it added as a page.
> Anyone have any ideas ?
> 
> Rich
>


 
Yahoo! Groups Links



 






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Attachment: Help.mxml
Description: Binary data

Attachment: Main.mxml
Description: Binary data

Reply via email to