A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [MX04] Please look at this code and tell me what I'm doing wrong!

  1. #1
    Junior Member
    Join Date
    Aug 2006
    Posts
    13

    [MX04] Please look at this code and tell me what I'm doing wrong!

    Help! I am trying to print our multiple copies of the same image on one sheet of paper. The image is one of several contained within a movie clip (tempbox). The user is to choose the image that they like best then press the print button which sends the contents of tempbox into six different movie clips (print 1,print2,etc.)which are contained within another movie clip off-screen that will ultimately print (printtemp). Here's the code I've written so far:

    stop();
    btn.onRelease = function() {
    print1.attachMovie("tempbox","tempbox",1);
    print2.attachMovie("tempbox","tempbox",1);

    var pj = new PrintJob();
    var success = pj.start();
    if (success) {
    pj.addPage ("printtemp",bframe);
    pj.send();
    }
    delete pj;


    The print template prints (I get six boxes) but there are no images in the boxes. Anyone know what I'm doing wrong?

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Location
    FL, USA
    Posts
    442
    Why do you have to use PrintJob?
    Code:
    printAsBitmap("target" , "bframe");
    should work.

  3. #3
    Junior Member
    Join Date
    Aug 2006
    Posts
    13
    The printAsBitmap command works better than my original code(all six boxes appear in the proper placement) unfortunately the boxes are still empty. The tempbox movie clip is not loading into the print1,print2... movie clips. Anythoughts on how to make this work?

  4. #4
    Senior Member
    Join Date
    Apr 2005
    Location
    FL, USA
    Posts
    442
    Oh, well the attachMovie has to work before the printing of the MC will, lol. Did you set the linkage id of the MCs you want to attach? To do that, right-click the MC in your library, select "linkage". Click "export for actionscript" and type "tempbox" into the "identifier" field. And idk what your setup is, but you're attaching MCs to "print1" and "print2" but you're printing "printtemp".

  5. #5
    Junior Member
    Join Date
    Aug 2006
    Posts
    13
    I had already set up the linkage id for the movieclip, so its not that, unless it has something to do with the second "tempbox" in the attachmovie command line within the brackets. As for the way the printtemp is set up hidden off screen I have a movie clip called printtemp and within that movie clip I have the six movie clips print-print 6. It's complicated I know but these images are to go on label paper so the images have to be in the proper position.

  6. #6
    Junior Member
    Join Date
    Aug 2006
    Posts
    13
    Well I figured out something that worked:

    btn.onRelease = function() {
    _root.printtemp.print1.attachMovie("tempbox","temp boxt",3);
    _root.printtemp.print2.attachMovie("tempbox","temp boxt",3);

    printAsBitmap("printtemp","bframe");
    }

    However, it will only load the first frame of the "tempbox" movie clip into the print1.... movie clips, which is blank. So now I need help to either:

    A) figuring out how to get particular frames that would be chosen by the user, from the "temp box" movie clip into the print movie clips

    or

    B) ditching this method all together and figuring out a way to print out multiple clipc of the "tempbox" frame onto a single sheet of paper in the correct positions (This was my original line of thinking but I could not figure out how to write a code to do that)

    If anyone as has any thoughts on how to do either of these thing I will be eternally grateful, as I am to you BobJohnson at the present moment. This is the last thing I have to figure out for this damn project than I'm done!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center