A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Printing part of a frame from a projector file

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    17

    Printing part of a frame from a projector file

    Im in the process of making a game for kids where they can create their own vehicle. Is there a way I can create a print button to print just part of the frame (the bit with their vehicle on) and to print only that 1 frame and not the rest in the time line, although I will also need to be able to print the other frames when the user is on them. I hope that makes sense!

    I've seen a few tutorials but still cant seem to get it right

    Thanks Steve

  2. #2
    Junior Member
    Join Date
    Oct 2008
    Posts
    17
    I'd be happy with printing the whole page but just the frame that you are on not all of them, from what I've seen the below should work but it still prints all frames.

    getURL("printAsBitmap:","window=/InstanceNameHere");

    Does anyone have any ideas? Thanks Steve

  3. #3
    the cheesy child bounceboy's Avatar
    Join Date
    Dec 2008
    Location
    Australia
    Posts
    323
    getUrl? don't use that if you are making a projector file! but don't worry, its as simple as print();
    well not just print() there is parameters but yeah.
    put the printable stuff in a movieclip so that the print() function will have a target instead of allowing all frames to be printed.
    print(target,someThing);

    target is where you will put the instance name of the movieclip. or put _root if its the main stage.

    where someThing is you can put one of the following:

    bmovie Designates the bounding box of a specific frame in a movie clip as the print area for all printable frames in the movie clip. Assign a #b frame label to the frame whose bounding box you want to use as the print area.
    bmax Designates a composite of all the bounding boxes of all the printable frames as the print area. Specify bmax if the printable frames in your movie clip vary in size.
    bframe Indicates that the bounding box of each printable frame should be used as the print area for that frame, which changes the print area for each frame and scales the objects to fit the print area. Use bframe if you have objects of different sizes in each frame and want each object to fill the printed page.

    i copied that info right from flash so please don't say it doesn't make sense.
    Last edited by bounceboy; 03-13-2009 at 06:40 AM. Reason: I made a few mistakes...

  4. #4
    Junior Member
    Join Date
    Oct 2008
    Posts
    17
    Thanks for your help, I'll try that

  5. #5
    Junior Member
    Join Date
    Oct 2008
    Posts
    17
    D'oh! I still cant get it to work.

    on (release){
    print(testy, bmovie);
    }

    testy is the instance name of the movieclip
    and I've assigned a #b frame label to the frame with the correct bounding box.

    It comes up with this error:

    **Error** Scene=Scene 1, layer=print button, frame=3:Line 2: Bounds type must be bmovie, bframe or bmax
    print(_root, bmovie);

    Total ActionScript Errors: 1 Reported Errors: 1

    I'm guessing I've missed something simple?

    Thanks Steve

  6. #6
    the cheesy child bounceboy's Avatar
    Join Date
    Dec 2008
    Location
    Australia
    Posts
    323
    use "" for bmovie.
    so do this:
    print(_root, "bmovie");

    EDIT: you actually have to use the "" if you use bmax or bframe or any of them!

    Also i like the idea of your game and wish you luck
    Last edited by bounceboy; 03-13-2009 at 09:02 PM.

  7. #7
    Junior Member
    Join Date
    Oct 2008
    Posts
    17
    Thankyou very much, it works! You're a legend mate, I knew it would be quite simple but for some reason I just couldnt figure it out

    on (release){
    print("testy", "bmovie");
    }

    Thanks again

  8. #8
    the cheesy child bounceboy's Avatar
    Join Date
    Dec 2008
    Location
    Australia
    Posts
    323
    that's alright, everybody makes mistakes! I hope your game is successful!

  9. #9
    Junior Member
    Join Date
    Oct 2008
    Posts
    17
    Cheers, its just a bit of fun really, just something im working on when we're not busy at work.

    Just checked out your website, it mad! I like it!

  10. #10
    the cheesy child bounceboy's Avatar
    Join Date
    Dec 2008
    Location
    Australia
    Posts
    323
    really? cool, thank you for that! do you have a website?

    if you do PM me please

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