Archived Message:
Using the OnLoad tag in an ebook
brainsci
I would like to have ebook pages that open an executable (embedded in an ebook) as the page loads.Here is the body tag that isn't working:
<BODY onLoad="##RUN('{ebook}\program.exe')">
Can anyone see what I'm doing wrong? Or better, Can anyone tell how to do it right?
Many thanks in advance, T.R.M.
Posted on: 1:18 am on September 12, 2005
EBookCompiler
onLoad requires JavaScriptRUN is Activ Script
So what you need to do is use the JavaScript/Activ Script integration: window.external.ActivRun
It's in the help
Posted on: 7:45 am on September 12, 2005
brainsci
I'm afraid I don't know how to install an active variable.The command seems easy enough, but how do I tell actve ebook to use it.
The help file says that a tutorial would be bigger than the help file itself. There is no button to 'add'
Surely ther must be a way a newbie can add at least one of the predefined active variables.
This is the only one I need to add.
Would you consider adding a couple of "aep" files that have active scripts already installed to the website.
An example or two woudl be very halpful, now that you have told me script ( window.external.ActivRun ) I need to use.
Is there any way I, who am not a programmer, can get this installed in my ebook?
Thanks.
Posted on: 6:41 pm on September 12, 2005
EBookCompiler
In JavaScript, inside a SCRIPT tag you could use dowindow.external.ActivRun('{ebook}\\program.exe')
The double \ is necessary because it's JavaScript escaping for a \
Posted on: 6:54 pm on September 12, 2005
brainsci
Is this is the script I need (Yes, it was in the help)?<script> window.external.ActivRun('{ebook}\\PROGRAM.EXE') ; </SCRIPT>
I saved the script above to a text file called OnLoad.as .
But how do I set it to run when a page is opened? The same OnLoad tag still gives an error when I run it like this:
<BODY onLoad="##RUN('{ebook}\OnLoad.as')">
I need to have this work for specific pages, not when the ebook is opened.
I appreciate your help with this.
I do not know programming, but I can figure things out - especially when they bear any resemblance to installing javascripts.
Posted on: 7:41 pm on September 12, 2005
EBookCompiler
Try onLoad="window.external.ActivRun('{ebook}\\program.exe')"
OnLoad= must contain javaScript code
Posted on: 10:18 pm on September 12, 2005
brainsci
It worked!!For Newer-bies than myself, here's the final instruction:
Replace <BODY> (in the code for the page for which you want an exe to open as the page loads) with this:
<BODY onLoad="window.external.ActivRun('{ebook}\\program.exe')">
THANKS, PANDITJI !!!
You're a prince among programmers.
Note that this code will only work with executables (or batch files) embedded in the software. Other variations are possible.
Posted on: 5:34 am on September 13, 2005
Go to discussion thread
Participate in current/new discussions
Copyright © 2000-2008, Answers 2000 Limited .
With any business, it is up to the individual owner of said business to ensure the success of the business. You may make more or less than any sample figures or results that might be quoted on our web sites or other publications. All business involves risk, and many businesses do not succeed. Further, Answers 2000 Limited does NOT represent that any particular individual or business is typical, or that any results or experiences achieved by any particular individual/business is necessarily typical.
About and Terms Of Use
Privacy