10 Replies Latest reply: Jul 9, 2010 8:03 AM by ecg2000 RSS

    Javascript not functioning for all users

    ecg2000

      I've got a .cp file with an On Slide Enter:Execute Javascript action on the last slide. The javascript is this: Javascript:button23574.actionShow();

      I publish the file to swf/html and import it into a Lectora title. The javascript is intended to display a transparent button over the swf file which the user clicks to close/hide the swf file.

       

      When I publish the Lectora title, the javascript seems to work for some users and not others. I have changed the transparent button to an image which I've relocated on the page and (since my computer is one that this does not function on), when the last slide plays, the button does not display. And yet on other computers, it works just fine.

       

      Is there something I can change in Captivate to make this work for all users? Is there a setting/add-on/plug-in that my computer requires???

       

      Any help is appreciated! Thanks!

        • 1. Re: Javascript not functioning for all users
          CarlJFink Community Member

          Gather a little more information.  In particular, is the problem related to browser versions?  Different browsers and versions have different JavaScript engines and do work somewhat differently.

           

          In your situation (a situation I am in fact in as a Lectora/Captivate developer) I would simply create a button in Captivate to do what I want, instead of playing around trying to communicate between Captivate and Lectora.

          • 2. Re: Javascript not functioning for all users
            ecg2000 Community Member

            You know, at first I thought it was a browser version issue. I'm using IE 6 (the standard in our organization - yikes!) and the first colleague who tested it was using IE 8. But then I asked another colleague who has IE 6 to test it and it worked for her too. I've changed all my security settings to be the same as hers and it still doesn't work for me.

             

            I'd consider making the change you suggest in Captivate, but I have no clue about javascript!   Perhaps you can help?  What javascript would I have to use to hide the swf file?

            • 3. Re: Javascript not functioning for all users
              ecg2000 Community Member

              And I don't know if it's worth mentioning, but it also doesn't work in Firefox for me either. And my version of Firefox is the most current.

              • 4. Re: Javascript not functioning for all users
                Steve Howard, ACP Community Member

                You don't need JavaScript. You just need a button in Captivate with the click function set to Show button23574

                 

                Steve

                • 5. Re: Javascript not functioning for all users
                  ecg2000 Community Member

                  Steve, that sounds straightforward enough, but when I choose Show, the only options in the drop down are the existing objects on the slide. It doesn't allow me to enter Button23574. Am I missing something?

                   

                  Cheers,

                  Erin

                  • 6. Re: Javascript not functioning for all users
                    CarlJFink Community Member

                    Erin, "Button23574" should BE an object on the slide.  You can't show nonexistent objects.

                    • 7. Re: Javascript not functioning for all users
                      ecg2000 Community Member

                      What I need is a button (transparent) that the user clicks to close the published swf file.

                       

                      If I add the button in Captivate, I don't see an action that will close the file. I think I could add javascript that will close the window, but the swf will be embedded in an html file created in Lectora and I don't want the window to close - only the swf.

                       

                      So when I have a button in Lectora and on slide enter or exit, use javascript in Captivate to show the button, it works for some users, but not on my computer...

                       

                      Is there a way to have a button in captivate close the swf?

                      • 8. Re: Javascript not functioning for all users
                        Captiv8r ACP/MVPs

                        Hi there

                         

                        ecg2000 wrote:

                         

                        What I need is a button (transparent) that the user clicks to close the published swf file.

                         

                        If I add the button in Captivate, I don't see an action that will close the file. I think I could add javascript that will close the window, but the swf will be embedded in an html file created in Lectora and I don't want the window to close - only the swf.

                         

                        So when I have a button in Lectora and on slide enter or exit, use javascript in Captivate to show the button, it works for some users, but not on my computer...

                         

                        Is there a way to have a button in captivate close the swf?

                         

                         

                        The simplest way to accomplish this is by configuring the Start and End options for the project so the project closes after the SWF completes. Then you program the Button to jump to the last slide. The net result is that the last slide is presented, the end action attempts to close the SWF and if it can be closed (depending on how it was opened to begin with it may not close) it closes.

                         

                        Cheers... Rick

                         

                        Helpful and Handy Links

                        Captivate Wish Form/Bug Reporting Form

                        Adobe Certified Captivate Training

                        SorcererStone Blog

                        Captivate eBooks

                        • 9. Re: Javascript not functioning for all users
                          CarlJFink Community Member

                          A Lectora button can certainly hide a SWF (or any  other animation).

                          • 10. Re: Javascript not functioning for all users
                            ecg2000 Community Member

                            Yes - I think to do what I want it to do, I need to use the button in Lectora to hide the swf. I've tried the other suggestions so far (i.e., a button on the second to last slide and the close project options) but they both close the window and not the swf file alone.

                             

                            I did, however, finally figure out what the problem was. Even though I had run the swfs hundreds of times with no error messages, I finally got an error message that took me to an Adobe page. Turns out to be a problem with the global security settings in the Flash Player that occurs for content creators. Here's the gist of the page and a link to it:

                             

                            ---------------------------------------------------

                             

                            Adobe - Flash Player : Settings Manager - Global security settings for content creators

                            If you create or manage content that runs in Flash Player 8 or later, the information on this page is relevant for you.

                             

                            You are most likely seeing this page because you are testing your SWF or FLV content locally, and that content is trying to use older security rules to communicate with the Internet. This page provides information about how to test your content locally when it runs in Flash Player 8 or later.

                             

                            As a Flash developer, you might often work on SWF or FLV content that is eventually deployed on the Internet. During development of these applications, you might need to perform testing while the SWF or FLV content is stored locally on your own computer, rather than deployed on a web server. In this local testing situation, Flash Player might show security warnings that prevent your application from functioning as intended. You can resolve this issue by using the Settings Manager to designate your own SWF or FLV content as trusted.

                             

                            ---------------------------------------------------

                             

                            Thanks for all the help and suggestions!