How to Insert and call custom Code in CaptivateMainTimeine.as?
I have been trying to get my head around this, using various blog postings by Jim Leichliter as my guide. However, so far I have been defeated.
This is what I attempted (in Captivate 5):
1) I inserted the following code into CaptivateMaintimeline.as, just above the private function AddEICallbacks() section:
public function helloWorld(){
alert('hello world');
}
2) Just above the EICallbacksAdded = true; line, I inserted
ExternalInterface.addCallback("helloWorld", helloWorld);
3) I created a one-slide Captivate 5 presentation with a button whose "On Success" action is set to "Execute Javascript".
4) In the "Execute Javascript" Script_Window, I entered this code:
Captivate.helloWorld();
5) I published the presentation and viewed it in Chrome, Firefox and IE 9, which all reported an error, as follows:
(Chrome) "Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'helloWorld'"
(Firefox) "Captivate is not defined"
(IE 9) "Object doesn't support property or method 'helloWorld'"
6) I changed the script window code to
document.Captivate.helloWorld();
and published and viewded in Chrome in Firefox, with the following results:
(Chrome) "Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'helloWorld'"
(Firefox) "document.Captivate.helloWorld is not a function"
7) I also tried
