List Info

Thread: Question on PrintJob Class




Question on PrintJob Class
country flaguser name
United States
2007-08-19 16:11:55
Has anyone played around with the PrintJob class enough to
know if there
is a way to use it without bringing up the Print Dialog Box?
I want to
use it in a kiosk application, but I'm not having any luck
in my
searching. I haven't found a good (working) method in php or
java
either. If anyone knows of one that works I would appreciate
the info.
Thanks.
 
Barry
 
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: Question on PrintJob Class
country flaguser name
United States
2007-08-19 14:43:11
If you're making a kiosk app, you might want to check out
one of the Flash
wrapper apps like Screenweaver, Zinc, SWF Studio, etc.  I've
used SWF
Studio ( http://northcode.com/ ) to
do what you're asking about, and there
are many other things in it that are specifically useful for
kiosk
applications.

Helen
--
http://flash-creations.com


> Has anyone played around with the PrintJob class enough
to know if there
> is a way to use it without bringing up the Print Dialog
Box? I want to
> use it in a kiosk application, but I'm not having any
luck in my
> searching. I haven't found a good (working) method in
php or java
> either. If anyone knows of one that works I would
appreciate the info.
> Thanks.
>
> Barry

_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Key combo question
country flaguser name
United States
2007-08-20 09:18:45
HI all. Quick question. I have this code in my Flash 8
file:

//define objects:
var oMod20KeyListener:Object = new Object();
//launch web link (key combo)
oMod20KeyListener.onKeyDown = function() {
	if (Key.isDown(Key.CONTROL) && Key.getCode() == 65)
{  //Ctrl+A
		trace("CONTROL + A down");
	}
};
Key.addListener(oMod20KeyListener);

This does not work. Nothing happens when you press the keys.
However,
this DOES work:

//define objects:
var oMod20KeyListener:Object = new Object();
//launch web link (key combo)
oMod20KeyListener.onKeyDown = function() {
	if (Key.isDown(Key.SHIFT) && Key.getCode() == 65)
{//Shift+A
		trace("Shift + A down");
	}
};
Key.addListener(oMod20KeyListener);

Any ideas why CONTROL doesn't work but SHIFT does?

Thanks.

Dave

_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: Key combo question
user name
2007-08-20 10:05:34
Did you disable your keyboard shortcuts while testing in
flash?

Control>Disable Keyboard shorcuts

...helmut

On 8/20/07, Vaughn, David (Contractor) (J6B)
<David.Vaughn.ctrdla.mil>
wrote:
>
> HI all. Quick question. I have this code in my Flash 8
file:
>
> //define objects:
> var oMod20KeyListener:Object = new Object();
> //launch web link (key combo)
> oMod20KeyListener.onKeyDown = function() {
>         if (Key.isDown(Key.CONTROL) &&
Key.getCode() == 65) {  //Ctrl+A
>                 trace("CONTROL + A down");
>         }
> };
> Key.addListener(oMod20KeyListener);
>
> This does not work. Nothing happens when you press the
keys. However,
> this DOES work:
>
> //define objects:
> var oMod20KeyListener:Object = new Object();
> //launch web link (key combo)
> oMod20KeyListener.onKeyDown = function() {
>         if (Key.isDown(Key.SHIFT) &&
Key.getCode() == 65) {//Shift+A
>                 trace("Shift + A down");
>         }
> };
> Key.addListener(oMod20KeyListener);
>
> Any ideas why CONTROL doesn't work but SHIFT does?
>
> Thanks.
>
> Dave
>
> _______________________________________________
> Flashnewbiechattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
>
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: Key combo question
country flaguser name
United States
2007-08-20 10:56:21
Helmut and Kerry,

Yes when testing within the Flash environment I double
checked and
Keyboard Shortcuts are disabled. When I make either an SWF
or an EXE
using Control+A won't work either. I will trace whether
Key.getCode() is
tracing out to A or something else.

I checked the help files and it says that you can do this
with the
CONTROL key. Here is the sample from the help file:

Example
The following example assigns the keyboard shortcut
Control+7 to a
button with an instance name of my_btn and makes information
about the
shortcut available to screen readers (see _accProps). In
this example,
when you press Control+7 the myOnPress function displays the
text hello
in the Output panel. 

function myOnPress() {
    trace("hello");
}
function myOnKeyDown() {
    // 55 is key code for 7
    if (Key.isDown(Key.CONTROL) && Key.getCode() ==
55) {
    Selection.setFocus(my_btn);
    my_btn.onPress();
    }
}


Thanks.

Dave


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: Key combo question
country flaguser name
United States
2007-08-20 11:22:49
David Vaughn wrote:

> I will trace whether Key.getCode() is
> tracing out to A or something else.

Let us know what the result is.

> I checked the help files and it says that you can do
this with the
> CONTROL key. Here is the sample from the help file:
> 
> function myOnKeyDown() {
>     // 55 is key code for 7
>     if (Key.isDown(Key.CONTROL) &&
Key.getCode() == 55) {
>     Selection.setFocus(my_btn);
>     my_btn.onPress();
>     }
> }

Ah, there's all the difference in the world between ctrl-A
and ctrl-7.
Ctrl-A through Ctrl-Z are legacy control characters from the
old DOS days
and before. They're defined in the ASCII spec, and, while we
don't use ASCII
much any more, those characters are still non-printing
control characters.
They are used for everything from serial communications
(ACK, ENQ) to EOL
markers (CR, LF) to making the speaker beep (BEL) to marking
the end of a
DOS file (SUB).

On the other hand, Ctrl-7 is not a defined ASCII character,
so the key code
should pass through unmolested.

That trace will be the key. I bet you'll find it's not
tracing "A".

Cordially,

Kerry Thompson


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: Key combo question
country flaguser name
United States
2007-08-20 11:58:52
Kerry,

Seems that your suggestion is correct. if I change the key
sequence to
Control + any number 0 through 9 it works perfectly.
However, if I
change it Control + any letter key if always fails. Based on
this
outcome I might have to break this up into separate
functions. One
function could test to see if Control is down. If so, set a
variable and
launch another function based on that variable. Something
along those
lines might work.

It would have been nice had Adobe (actually, Macromedia in
this case)
let users know that using the Control key in this manner has
some
limitations. 

Anyway, thanks for the info Kerry! I'll see what kind of
solution I can
come up with.

Regards,

Dave

-----Original Message-----
From: flashnewbie-bounceschattyfig.figleaf.com
[mailto:flashnewbie-bounceschattyfig.figleaf.com] On
Behalf Of Kerry
Thompson
Sent: Monday, August 20, 2007 12:23 PM
To: 'Flashnewbie Mailing List'
Subject: RE: [Flashnewbie] Key combo question

David Vaughn wrote:

> I will trace whether Key.getCode() is
> tracing out to A or something else.

Let us know what the result is.

> I checked the help files and it says that you can do
this with the 
> CONTROL key. Here is the sample from the help file:
> 
> function myOnKeyDown() {
>     // 55 is key code for 7
>     if (Key.isDown(Key.CONTROL) &&
Key.getCode() == 55) {
>     Selection.setFocus(my_btn);
>     my_btn.onPress();
>     }
> }

Ah, there's all the difference in the world between ctrl-A
and ctrl-7.
Ctrl-A through Ctrl-Z are legacy control characters from the
old DOS
days and before. They're defined in the ASCII spec, and,
while we don't
use ASCII much any more, those characters are still
non-printing control
characters.
They are used for everything from serial communications
(ACK, ENQ) to
EOL markers (CR, LF) to making the speaker beep (BEL) to
marking the end
of a DOS file (SUB).

On the other hand, Ctrl-7 is not a defined ASCII character,
so the key
code should pass through unmolested.

That trace will be the key. I bet you'll find it's not
tracing "A".

Cordially,

Kerry Thompson

_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: Key combo question
country flaguser name
United States
2007-08-20 13:34:16
David Vaughn wrote:
 
> Seems that your suggestion is correct. if I change the
key sequence to
> Control + any number 0 through 9 it works perfectly.
However, if I
> change it Control + any letter key if always fails.

There may be a way around this. What you're looking at with
Key.getCode() is
the ANSI, or more likely Unicode, character code (they are
actually the same
in the single-byte range 0-127).

There are two things at play here. First, Key.getCode()
doesn't
differentiate between upper and lower case. You might try
Key.getAscii(),
which does. I don't have a lot of confidence that will work,
though,
because...

The firmware in your keyboard sends a code to the OS that is
neither ASCII,
ANSI, nor Unicode. The BIOS, I believe, translates this code
into the
appropriate ANSI code (not really ANSI, which is strictly
Western European,
but will do for now).

For example, the arrow keys aren't defined in the ANSI
standard. That's why
we have Key.UP, Key.RIGHT, etc. properties.

In Director, there is a way of getting this with keyCode, or
_key.keyCode.
I've used it to capture ctrl-alt-delete, for example. I'm
not sure what the
equivalent is in ActionScript, or if there is one. I'd be
interested to find
out myself.

Cordially,

Kerry Thompson

P.S: If you want more information on ASCII, ANSI, ISO 8859,
code pages, and
the like, you can read my article at

http://director-online.com/buildArticle.php?id=1143. It
was written for the
Director community, but almost everything is applicable
across all
programming languages. It's also a little out of date, in
that ISO 8859 has
been expanded since I wrote it, but everything is still
valid.

I got an angry e-mail from one programmer because I didn't
cover his
specific question concerning Polish fonts. I actually knew
the answer, but
this is an article, not a book. If it doesn't answer your
specific question,
send me a _nice_ e-mail, and I'll answer if I can.


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: Key combo question
country flaguser name
United States
2007-08-21 08:24:56
Well, still working on this. So far no luck. Here's my
latest attempt
(mind the text wrap):

createTextField("message_txt", 100, 0, 0, 550,
400);

var ctrlPressed:Boolean = false;
var ctrlKeyListener:Object = new Object();
var letterKeyListener:Object = new Object();

ctrlKeyListener.onKeyDown = function() {
	if (Key.getCode() == 17) {
		ctrlPressed = true;
		message_txt.text = "CTRL down";
	}
};

letterKeyListener.onKeyDown = function() {
	if (ctrlPressed == true && Key.getCode() == 65) {
		message_txt.text = "CTRL+A down";
	}
};

Key.addListener(ctrlKeyListener);
Key.addListener(letterKeyListener);

My thinking was that if I created two separate listeners
rather than one
the problem might be solved. No such luck.

As Kerry pointed out yesterday, when Control is pressed
*some* alpha
characters are simply ignored as far as I can tell. From my
limited
testing the A and C keys are ignored, however the B and D
keys work just
fine. I have not gone through the entire alphabet but I do
know at least
the A and C keys won't work this way.

Any suggestions?

I found another method here, but have not tried it as of
yet:

//http://livedocs.adobe.com/flash/mx2004/mai
n_7_2/wwhelp/wwhimpl/common/
html/wwhelp.htm?context=Flash_MX_2004&file=00001376.html


Thanks.

Dave

_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: Key combo question
country flaguser name
United States
2007-08-21 11:00:09
David Vaughn wrote:

> As Kerry pointed out yesterday, when Control is pressed
*some* alpha
> characters are simply ignored as far as I can tell.
From my limited
> testing the A and C keys are ignored, however the B and
D keys work just
> fine. I have not gone through the entire alphabet but I
do know at least
> the A and C keys won't work this way.

I don't know for sure which ones will work. Ctrl-C is
probably trapped by
the system, because that's the old DOS equivalent of
ctrl-alt-delete. I
don't know why Ctrl-A isn't working--it's used in serial
communications to
mark the start of a header (SOH).

The only way I know to find out which ones will work is to
try them all. I'd
also use getAscii() instead of getCode(), because getCode()
doesn't
differentiate between upper and lower case. I don't know if
Ctrl-c is any
different from Ctrl-C, but it would be worth a try.

Cordially,

Kerry Thompson


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

[1-10] [11]

about | contact  Other archives ( Real Estate discussion Medical topics )