disable ctrl-p for a page contain .swf

Posted on 2004-04-22
Medium Priority
Last Modified: 2012-06-21
i have an intranet with html page how contain swf animation.
i can control the print in the html page but when i give the focus to the swf animation i can print the page and it's content.
i want to know if it's possible to disable the print fonction (file print, ctrl-p) for this case.

thanks a lot.
Question by:mirsim
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 36

Expert Comment

ID: 10892706
I'm not sure what you want, but this page:


if you can modify your Flash script, disables the print inside the Flash. This may work to disable the print option in Flash, but you probably can still use Ctrl+P.

You probably are disabling print in your HTML page using suppress right click and using onkeypress to check for Ctrl+P. Possibly you can check for that in your Flash script and suppress it, but otherwise, I dunno.


Author Comment

ID: 10892781
i try the trick of macromedia (!#p) but this solution don't disable the print of the html page by IE when the flash animation have focus.

Expert Comment

ID: 10893107
You can't control File -> Print..

Maybe you can make an additional "Printer Friendly" page where you won't have to worry about the flash or graphics if that is the case.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

LVL 36

Expert Comment

ID: 10903407
dgelinas is right. You can use tricks to try to delay or make printing more difficult, but you can not really disable it. For instance, things you can do:

Use the !#p to prevent printing in Flash.
Disable Ctrl+P in browser with onkeypress.
Disable right menu or make your own without print.
Make a Printer Friendly page as dgelinas suggests.
Post a notice that you should print at the Printer Friendly page.

Most of the Internet users will not try to print your page if they can't use shortcuts (They can always use File->Print). The ones that are determined enough should be smart enough to use the Printer Friendly page.


Author Comment

ID: 10917647
this is the first part of my problem. The worst is that all that "very important" flash animation are in an intranet.
By default all pages open in fullscreen then, the user cannot print or desactivate the fullscreen mode because i catch the keypress.
My big problem is that if i click on a flash animation, the keypress aren't catchable anymore....
an my client says : " everyone can see the path an then go to the location and download the animation..."

What can i do for this ????
LVL 36

Expert Comment

ID: 10923000
It may be possible to put in your <BODY> tag:

<body onBlur="this.focus();">

This would be best if your Flash animation doesn't need the user to click or type anything. If the user only needs to click a button, this code may still work.

LVL 36

Accepted Solution

Zyloch earned 500 total points
ID: 10933336
This might fail if the user rapid-clicks on the Flash, in this case, this may be more desirable:

<body onBlur="setTimeout('window.focus',100);">

I changed this.focus() to window.focus() because in my testing, window.focus() appeared to work faster and better.


Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question