Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

618 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