Be a Supporter!

AS:Print

  • 2,755 Views
  • 24 Replies
New Topic Respond to this Topic
Thomas
Thomas
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 13
Musician
AS:Print 2005-12-11 21:07:43 Reply

Hello.I'm not sure if Printing in Flash is really a big deal for the Newgrounders,but maybe for big companies with Flash websites...anyways,printing is rather easy.

Ok...First of all,create a button.Have text in the button say "Print" or however anyone says print...

Well,give it the instance of "print".

Now,add these actions to your frame...

_root.print.onRelease = function() {
var pri = new PrintJob();
pri.start();
pri.paperWidth = 800;
pri.paperHeight = 600;
};

If you did all right,a Print screen should pop-up asking for the Print setting and all that.

Well,this tutorial wouldn't do good without explaining,just to make it longer.

_root.print.onRelease = function() {
}

This code is the onRelease function for setting a code to a button,but not in the button actions...or whatever...

var pri = new PrintJob();

'var' will set a new variable.The variable name is 'pri',short for print.'new PrintJob' is stating that there will be a new print.

pri.start();

This code allows the print to start,or open up the window to start.

pri.paperWidth = 800;
pri.paperHeight = 600;

Sets the width and the height of the print.I'm just using 800x600.

Well that's pretty much all...might be to easy,but I doubt anyone on Newgrounds really cared to look into the Print.I'm just trying to make AS:Main bigger :D


wat
a compessor wil raise the volume while lowering the db - chronamut

Madferit
Madferit
  • Member since: Jul. 29, 2005
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to AS:Print 2005-12-11 21:09:50 Reply

Good job. I think most people knew this already but to the people that didn't this is helpful.

Thomas
Thomas
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 13
Musician
Response to AS:Print 2005-12-11 21:11:01 Reply

Example.


wat
a compessor wil raise the volume while lowering the db - chronamut

shazwoogle
shazwoogle
  • Member since: Sep. 27, 2004
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to AS:Print 2005-12-11 21:17:58 Reply

lol cool kinda usless but not realy

Thomas
Thomas
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 13
Musician
Response to AS:Print 2005-12-11 21:23:47 Reply

At 12/11/05 09:12 PM, DemonHurter wrote: um yeah

First time poster in one of my threads ;)


wat
a compessor wil raise the volume while lowering the db - chronamut

Glaiel-Gamer
Glaiel-Gamer
  • Member since: Dec. 28, 2004
  • Offline.
Forum Stats
Member
Level 28
Game Developer
Response to AS:Print 2005-12-11 21:33:16 Reply

or you could just do

print()

or

printAsBitmap()

Ozcar
Ozcar
  • Member since: May. 12, 2002
  • Offline.
Forum Stats
Member
Level 32
Blank Slate
Response to AS:Print 2005-12-11 21:53:40 Reply

Pretty cool :)

I'll use it for the new website I'm making... These guys from the Tequila company wanted a function like this to print some stuff from their website...

Thomas
Thomas
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 13
Musician
Response to AS:Print 2005-12-11 23:19:16 Reply

Glad I can help out a mod :D


wat
a compessor wil raise the volume while lowering the db - chronamut

Acerbic
Acerbic
  • Member since: Nov. 7, 2004
  • Offline.
Forum Stats
Member
Level 35
Blank Slate
Response to AS:Print 2006-01-16 14:42:31 Reply

Pretty handy. Nice work -Thomas.

DragonFruit-Rock
DragonFruit-Rock
  • Member since: Dec. 31, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to AS:Print 2006-02-18 13:44:44 Reply

*yay!* ive been looking for a tutorial on this for AGES!!! thanks so much!!!!!!!!


If a man that always tells the truth comes up to you and says that another man always tells lies, and the man who always lies come up to you and says "I'm lying", then is he?

BBS Signature
liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to AS:Print 2006-02-18 13:50:24 Reply

Wow, that was kinda shit.. what about explaining print(), printNum(), printAsBitmap() and printAsBitmapNum()? If you explained all of them, how they're different, they're different parameters, etc - then maybe this coulda been useful.


Sup, bitches :)

BBS Signature
RyanPridgeon
RyanPridgeon
  • Member since: Dec. 7, 2005
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to AS:Print 2006-02-18 14:28:30 Reply

At 2/18/06 01:50 PM, -liam- wrote: Wow, that was kinda shit.. what about explaining print(), printNum(), printAsBitmap() and printAsBitmapNum()? If you explained all of them, how they're different, they're different parameters, etc - then maybe this coulda been useful.

hey man quit being so tight, we never saw you put effort in like this! >=|


I make flashes because I can.
PM me for anything flash or web related or visit my blog!!

BBS Signature
GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to AS:Print 2006-02-18 15:04:47 Reply

At 2/18/06 01:50 PM, -liam- wrote: Wow, that was kinda shit.. what about explaining print(), printNum(), printAsBitmap() and printAsBitmapNum()? If you explained all of them, how they're different, they're different parameters, etc - then maybe this coulda been useful.

you stole my sig

liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to AS:Print 2006-02-18 15:25:45 Reply

At 2/18/06 02:28 PM, ryanpridgeon wrote: hey man quit being so tight, we never saw you put effort in like this! >=|

Put effort into what? There was obviously no effort put into this tutorial because he didn't even explain all of what I said.

At 2/18/06 03:04 PM, ImpotentBoy2 wrote: you stole my sig

I told you already, I'm only going to have this conversation through my lawyer.


Sup, bitches :)

BBS Signature
Depredation
Depredation
  • Member since: Sep. 5, 2005
  • Offline.
Forum Stats
Member
Level 17
Game Developer
Response to AS:Print 2006-02-19 07:02:32 Reply

Is there a way to print a specific movie clip.

,Ali.


BBS Signature
Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to AS:Print 2006-02-19 07:06:15 Reply

At 12/11/05 09:33 PM, Glaiel_Gamer wrote: or you could just do

print()

or

printAsBitmap()

... Lol yeah. :P

It didn't cover everything about printing, and meh, it was a whole AS thread just about one small thing. It could be better, but it's alright, I guess.


BBS Signature
Depredation
Depredation
  • Member since: Sep. 5, 2005
  • Offline.
Forum Stats
Member
Level 17
Game Developer
Response to AS:Print 2006-02-19 08:40:58 Reply

Any ideas on how to print movie clips?

,Ali.


BBS Signature
crumbnumber1
crumbnumber1
  • Member since: Feb. 4, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to AS:Print 2006-06-16 13:21:13 Reply

Geez... im horrible with actionscript. Where do I put the instance name of the button? or... do I even do that?

NinoGrounds
NinoGrounds
  • Member since: Nov. 28, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to AS:Print 2006-06-16 13:44:23 Reply

Yes, nice, really nice.

RyanPridgeon
RyanPridgeon
  • Member since: Dec. 7, 2005
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to AS:Print 2006-06-16 13:46:28 Reply

Next time put a link to AS: Main.

Good tut though.


I make flashes because I can.
PM me for anything flash or web related or visit my blog!!

BBS Signature
Not-an-S
Not-an-S
  • Member since: Oct. 31, 2005
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to AS:Print 2006-07-03 22:00:06 Reply

The only other thing i was wondering is how to print multiple pages such as one saying:
LOL
and the other saying:
LMAO
without having 2 different buttons or print messages

Trunks
Trunks
  • Member since: Jul. 31, 2005
  • Offline.
Forum Stats
Member
Level 22
Musician
Response to AS:Print 2006-07-20 00:03:31 Reply

Sorry to bump this, but I just figured out you could use this to send an endless amount of print commands and screw with other's PCs, I should e-mail Adobe and see if they have a way of stopping it...

Wow, that would suck...

Ignore this post, I'm giving you people ideas....


Web developer, software engineer, musician, all-around nerd.

azza3809
azza3809
  • Member since: Jan. 14, 2006
  • Offline.
Forum Stats
Member
Level 26
Blank Slate
Response to AS:Print 2006-08-11 20:37:58 Reply

At 12/11/05 09:07 PM, -Thomas wrote: _root.print.onRelease = function() {
var pri = new PrintJob();
pri.start();
pri.paperWidth = 800;
pri.paperHeight = 600;
};

If your using flash mx pro 2004 you need to use this script

on(release){ _root.print = function() {
var pri = new PrintJob();
pri.start();
pri.paperWidth = 800;
pri.paperHeight = 600;
};
}

Just thought id contribute to this nicely

dJtl
dJtl
  • Member since: Oct. 12, 2007
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to AS:Print 2007-10-30 20:26:37 Reply

Does it print the whole screen? or just the flash or just the screen with a big white spot where the flash is?


BBS Signature
HorrificMonster
HorrificMonster
  • Member since: May. 11, 2004
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to AS:Print 2007-10-30 20:33:55 Reply

Good to know.... but I'm not sure exactly what I would use it for...