Copy link to clipboard
Copied
Is there a way to create a button that users can click to close the web browser window? Is it possible to do it through javascript embeded on the button action?
Thank you.
Copy link to clipboard
Copied
Hi there
The simplest way to do it is to configure the project to close when finished. Make sure the last slide in the project is timed super short. Perhaps .1 seconds long. Then configure the button to jump to the last slide.
User clicks Button and it jumps to the last slide. Movie closes if it can.
Note that closing windows is problematic (JavaScript or otherwise) because of so many variables in the mix. Browser used, how the window was opened to begin with, etc.
The bottom line here is that there quite simply is no 100% foolproof, works every time way to close the window. Just do a bit of Googling for "JavaScript Close Window" and you will find TONS of problem descriptions, suggested workarounds and the ultimate overall conclusion it can't be done reliably and consistently.
Cheers... Rick ![]()
|
Copy link to clipboard
Copied
Hello Rich,
When I tried your approach it didn't get ride of the swf file. The captivate slides are no longer visible but the nav bar is still there and the backgournd colour is visible. Is there are a way, with your method, to make the screen blank at the end of the project?
As for the Javascript function, I am having difficutly with it. I set a button to have the javascript code of an alert box with some basic text in it. I wanted proof the the button was working. I tried multiple variations of alert box javascript code, but nothing worked. Do you know what you have to put in the javascript window on a button to make an alert text box pop up when you click on it?
Thank you.
-Eric-
Copy link to clipboard
Copied
Hi Eric
As I said earlier. Play with JavaScript all you like. Good luck in finding a JavaScript method that will work 100% of the time. I've very doubtful you will.
The simplest test of JavaScript is the Alert, which you have tried. Often testing JavaScript will fail when testing locally. Sometimes it's because the Flash Security is blocking things. To fix that, click here and follow the instructions.
As for the slide, it all depends on your Captivate settings. If you want it blanked you can insert an image or something that would cover the background. Nav bar is another story. Probably just have to live with it that way or turn it off if you don't wish to see it. Or maybe insert a caption or image that indicates the movie has finished and to please close the window (since it didn't close automatically).
Cheers... Rick ![]()
|
Copy link to clipboard
Copied
Hi Rich,
Thank you for the information. I will definitely play around with background images and keep the nav bar's existence in mind if I need to hide the captivate project at the end. Also, thanks for the flash blocking hint. I was able to get some success when I put the file on a server.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more