PDA

View Full Version : Printing from movieclip


baddriverdave
04-29-2004, 12:25 PM
Hi folks. I am about done on this CD Rom project. Last thing I need to do is get the print function working. Basically, I have content being attached with .attachmovie("my_movieclip", "text"); In these movieclip I have a print button, with this code....

on(press){
printNum(_root.my_movieclip, "bmovie");
}

Now, I have about 30 of these movieclips that I'm attaching, and each one has a print button. They're (ideally) calling to the main movie and frames I've labeled with "#p" and given the instance of "my_movieclip". When the print is clicked, it should print up only that one single labeled frame/instance.

My problem is that when I click print for a movieclip, it prints all the frames labeled with #p, and it doesn't seem to recognize my instance names. If anyone could help me it would be much appreciated...

Thanks
Dave

Drakkon
04-29-2004, 12:44 PM
well hopefully since your posting in the AS 2.0 area that means you can start using the PrintJob class rather than the print function.
It gives you a lot more control over how and what prints without having to use those pesky #p's :D

baddriverdave
04-29-2004, 01:01 PM
Thanks for the reply....

well all right, I'm giving printjobs a try, but maybe I'm not understanding how you use it...I tried plugging this in to my print button and nothing happens....Here's what my code is looking like....

on(release){
account_pj = new PrintJob();
account_pj.start();
account_pj.addPage("account2info");
account_pj.send();
delete account_pj;
}

(And I did check my player properties and I'm using AS 2.0)

Thanks again

Dave

Drakkon
04-29-2004, 01:20 PM
is it bringing up the print dialog box? thats the first thing that should happen

Also since you have this all in your on action i assume your on a button so hopefully your directing to the correct movieclip

account_pj.addPage(_root["account2info"]); perhaps?

baddriverdave
04-29-2004, 02:03 PM
Thanks for replying Drakkon...

Well I tried it out, and realized that having my player preference set to 6 wasn't letting the print dialogue box open...However the print area is empty...it doesn't seem to see my movieclip....
Here's what I've got...

on(release){
account_pj = new PrintJob();
account_pj.start();
account_pj.addPage(_root["account2info"]);
account_pj.send();
delete account_pj;
}


once again thanks alot. I really appreciate the help.

baddriverdave
04-29-2004, 02:07 PM
AWESOME, thanks Drakkon, all i did was change

account_pj.addPage(root["account2info"]);


to

account_pj.addPage(account2info);

and it worked...
however...now I'm wondering if this can work for player 6.0 does anyone know?

baddriverdave
04-29-2004, 02:23 PM
and nevermind on that either. Just read the Actionscript Dictionary on that one. Sigh...well, time for a workaround...thanks anyways....