Skip to main content
August 24, 2007
Question

Relative link

  • August 24, 2007
  • 3 replies
  • 471 views
I could not find this in a search so here we go. I am creating a project for a customer and I want one Captivate .swf /web page open the next when it is completed. I would like to just to second.htm, I have tried everything in Navigation on the last slide, it doesn't like relative and creates this long link that will only work on my computer. I tried removing all the garbage so I just have the link with extension and it does not work. I have never had this problem in flash, dreamweaver, just Captive 2, I downloaded 3 and it does the same thing.

Anyone have any ideas, I thank you in advance.
    This topic has been closed for replies.

    3 replies

    Participating Frequently
    August 24, 2007
    If you're only going to publish as HTML/SWF and aren't interested in doing results tracking, you can easily pull off relative links in the browser using Javascript:

    1. In the standard.js file in the Adobe Captivate install directory (for Captivate 2, it's C:\Program Files\Adobe\Adobe Captivate 2\Templates\Publish\standard.js), add the following:

    function goToFile(sFile) { window.location.href = sFile; }

    2. In the Project Preferences of your Captivate movie, under Project end options, set the Action to Execute Javascript.

    3. To the right of the Execute Javascript field, click the ... (ellipses) button and type the following (including the quotes around the file path):

    javascript: goToFile('<relative or absolute path to the next .htm file>');

    Examples:

    javascript:goToFile('../lessontwo/intro.htm');
    javascript:goToFile(' http://myserver.org/courses/lessontwo/intro.htm');

    4. Publish and test.

    In step 3 above, I think you can use either single or double quotes, but my personal preference is to use single quotes inside a function call. Use whatever works for you.

    The only wrinkle with this approach is that you MUST publish to a web server or other trusted location for this to work. Otherwise, the Flash Player security settings will block the Javascript from being passed to the browser. To add a local or network folder as a trusted location for testing purposes, use the link Rick provided in his post above.

    FYI - The goToFile() function can also be used to reload the current file, as in the case of a "restart this lesson" button at the end of a quiz, but a much better approach would be to just put the following in the Execute Javascript action of your restart button:

    javascript:window.location.reload();
    August 24, 2007
    What do you set on the last slide in your navigation. It seems strange that the program allows you to set what to do after the slide ends in two different locations, but those locations don't say the same thing.
    RoboWizard
    Inspiring
    August 24, 2007
    Hi KeithJohnson

    Look at the project settings. There is a section that controls what happens when a movie finishes. You choose "Open other movie" or "Open other project". The part that fools folks is that you point at the other Captivate .CP file, not the HTM. Captivate knows how to sort it all out and it should work whether the movie is a .SWF or .EXE. Then you simply ensure both output files are in the same folder when you are finished.

    Captivate 2 - Click Project > Preferences...
    Captivate 3 - Click Edit > Preferences...

    Cheers... Rick
    August 24, 2007
    Rick,

    I sure wish I could say this works but it doesn't. Nothing opens. If I was to place it on my internet site opening another html page it works just fine. But in this case it is going on the customer computer and will be internal. The files are too big to be one big file. I am trying to do it with Cap 2, I tried 3 but I only have the 30 day demo and would hate to make any changes. I am not going to upgrade because I just purchase 2 in Feb.

    Any other thoughts.

    Have a good weekend,
    Keith
    Captiv8r
    Legend
    August 24, 2007
    Hi Keith

    Captivate 2 and 3 should behave identically in this respect. So upgrading shouldn't bring any new capabilities here. At least that I'm aware of.

    You said:
    It seems strange that the program allows you to set what to do after the slide ends in two different locations, but those locations don't say the same thing.

    It isn't really strange at all. For example, perhaps I have a menu slide at the beginning and most of my segments should return to the menu. In this case, the last slide of each segment might be configured to Jump to the menu slide. But perhaps the end of the movie (which may be on a slide all by itself as the last slide in the project) says to Open another movie. And it's in these movie (or more correctly for later versions - I still am stuck with calling it all a "movie" and should be saying "Project") properties where you configure it to open the other project.

    I'm wondering if what you are seeing is related to Flash Security settings? Perhaps take a look at this link and see if it makes any difference.

    Cheers... Rick