Captivate 2 JavaScript

Does anyone have a JavaScript to exit a project by clicking a
text button?

Hi BobACS and welcome to our community
Many Captivate users take this approach. If you poke around
the forums using the Search function, you should be able to find
such a script.
Personally, I tend to like to take a simpler approach. You
may wish to try it as well. Configure your project end option to be
"Close project". Then insert your text button and configure it to
jump to the last slide. When clicked, the last slide is presented
and the Captivate presentation closes if it is able. (Not all
browsers will allow the window to be closed, and some even ignore
fancy scripted methods.)
Cheers... Rick

Similar Messages

  • Javascript reference material for Captivate

    For the past day, I've been looking for reference material on using Javascript in Captivate. I really can't find much. There is nothing in the product Help, and these forums are pretty dry.
    The only thing I've found is http://captivatedev.com/series/captivate-javascript-series/, a really great introduction to using Javascript in Captivate. I wish there was more.
    Basically, I want to know what functions are available and how do I call them (i.e., what objects they are a part of, perhaps with some example code).
    Anyone know where I can find this for Captivate?

    Hello,
    Perhaps this is not really meant for you, but I did blog twice about the variables in Captivate, each time with a link to a more elaborate article. I thought them to be an introduction to get newbies in Captivate starting with variables and advanced actions (you'll find the links mentioned by Jim as well):
    Curious about variables?
    Unleash the power of variables with advanced actions
    Lilybiri

  • Stop Playing with JavaScript?

    I'm wondering if there's a way to use JavaScript to stop a Captivate SWF which is playing. Here's my scenario. I'm popping up a Captivate demo in an overlay above a page. That part works fine. But if the website visitor closes the overlay before the demo has finished it keeps on playing even though the overlay is no longer visible. That wouldn't really be a problem except that you can hear the audio continuing to play.
    And that wouldn't be a problem if I could turn off the audio but the option in Preferences only works partially. I've deselected both "Include audio" and "Play tap audio.." but all that does is turn off the typing sounds. You can still hear the mouse clicks.
    So, what I need is either a way to really turn off all audio or a way to stop the presentation from playing using JavaScript. Does anyone know a way?
    David Salahi

    Have a look over on Pipeworks lots of captivate javascript information available

  • Link to another Project folder

    I need to link to a module in another project folder. I used
    the click box and in the On Success chose Open other project and
    picked the swf file using the elipsis. However, when I ran it, it
    was looking for the file in the same folder as my current course
    not in the other project folder. Can I not link to another project
    folder using Captivate. We want to reuse components from one
    project to another without having multiple copies in every folder.
    Thanks for all your help.

    With JavaScript, you're limited primarily by your
    imagination, so the example I offered was intentionally generic.
    In practical use, you would probably want Captivate to pass
    only the destination folder & filename and let the JavaScript
    function create the full path. Assuming the relative folder
    structure is the same on each server, you'd only need a single
    generic function.
    For example, if you wanted to launch a file named
    "introduction.htm" in an adjacent folder named "course02", you
    could add the following to Captivate:
    javascript: goToMovie('course02','introduction.htm');
    and add the following to your standard.js file (so it gets
    automatically propagated to each published course):
    function goToMovie(strFolder, strFile)
    var arrPath = window.location.href.split('/');
    arrPath[arrPath.length-2] = strFolder;
    arrPath[arrPath.length-1] = strFile;
    window.location.href = arrPath.join('/');
    The Captivate function passes the folder and file name as
    quoted string variables and the JavaScript function then uses those
    variables to create a new URL. You can get as fancy as you like,
    such as adding logic to go up more than one folder level, but
    hopefully you get the general idea.

  • How do I open my TIF file into Camera Raw from Bridge?

    Trying to follow a tutorial on editing an HDR image in photoshop. When instructed to open the TIF image into Camera Raw from Bridge, I don't get the option when I right click. What is going on here?

    I was talking about an advanced action, which is not loaded externally but executed on runtime (will be translated to AS). So this will only work if you can pass the value of the variable containing the slide number you want to the SWF. For that you'll need JavaScript and I'm not that acquainted with JS. Have a look at Jim Leichliter's blog:
    http://captivatedev.com/series/captivate-javascript-series/
    In Captivate you create an advanced action to be triggered on entering the first slide, that will jump to the wanted slide number. If you can figure out how to pass the slide number, could help with the advanced action, I know them rather well:
    http://lilybiri.posterous.com/micro-navigation-in-adobe-captivate
    Lilybiri

  • Java Script for Add to Browser Favorites

    From what I understand the following script should work
    within Captivate:
    javascript:window.external.AddFavorite('
    http://www.testsite.com',
    testsite')">
    Any feedback would be appreciated.

    Welcome to our community
    Sometimes JavaScript works better if stored as a function in
    the corresponding HTM file Captivate produces. You then call the
    function from Captivate.
    You may also see where things are being blocked by the Flash
    Player if testing locally. To ensure this isn't the case, take a
    look at the tutorial linked below.
    Click
    here to view the tutorial
    Cheers... Rick

  • How do I collect user information without using an LMS?

    I have been using Captivate 5 to create training modules that we host on our own site.  The modules are information driven and have no testing included.  Our clients would like us to collect information from the user to track who has viewed the module.  All we need is their name and employee number.  Is there a way to accomplish this without having the user send an email?
    Thanks!

    It sounds like you're publishing your Captivate content as htm/swf output?
    If so and you have access to the services of a web developer, you can use Javascript in the web browser to pass the user information from Captivate out to the browser.  Once in the browser, you can then do anything with the data that your web developer can dream up.
    Jim Leichliter wrote a great series of articles that cover the basics of accessing Captivate variables using JavaScript.   This article in particular talks about passing Captivate variables out to the browser:
    http://captivatedev.com/2011/04/02/captivate-javascript-series-part-3-retrieving-captivate -variables/
    Cheers,
    John

  • Can I use JavaScript to force objects to overlap a Web Object in Captivate 7?

    Hi, so I have all of these great ideas for using Web Objects to enhance my courses, but am discouraged by the fact that I can't seem to get anything to overlap a Web Object. The only thing I can seem to get to overlap a Web Object is another Web Object. I have found that buttons seem to still work under the Web Object (which is good) but I really would like to know of a way to allow things on the Captivate timeline to be viewed on top of them. Things like text fields and images.
    I've seen posts about how to use JavaScript to have the menu show above Web Objects, but that code doesn't seem to work for regular objects. I read that Web Objects sit in an "<iframe>" tag and that that forces it to appear above everything else. I'm left wondering if it is possible to get around this by somehow putting Captivate objects in an <iframe> of their own with JavaScript? Or is there some other way? Does anybody know any JavaScript I can apply to Captivate objects to get them to appear above a Web Object?
    Thanks,
    Dan

    So I have come to learn that the "<iframe>" tag for a Web Object is simply a window that sits on top of the course. Now I'm wondering if anyone has an effective method for importing flash quality animation (in whatever form) that can sit underneath of Captivate objects and still be HTML5 compliant?
    Thanks,
    Dan

  • Captivate 8 - submit buttons/images no longer showing on devices after adding text with javascript

    I'm working on a Captivate 8 project to publish to devices through PhoneGap. This is working successfully on iPhone and Android so far. I have modified the quiz so I have 2 types of quizzes with 3 levels each without the final score showing at the end (they have to get the answer correct to move on to the next question).  The submit buttons and image I added to each slide has been working perfectly until I added a text caption with a variable to show "Q X of 6" for each question, with X being a variable that increments by 1 for each slide and then I have another script at the end of each level to reset the variable back to 0.  This is working, however the submit button/success message and image on each slide is now not showing.  The submit button appears to still be on the screen as I can click in the same area where the it should be and it works but appears to be faded completely out, and the success message now shows so lightly I can hardly see it. My image does not show at all now.  I've checked the timeline and they are all set the same, to appear for the rest of the slide.  Any ideas?

    actually I think it might be an issue related to upgrading my Mac from Mavericks to Yosemite as the app was working perfectly before. I stripped all the javascript off and repackaged and it's having the same issue so I don't think it's the javascript. I'm going to keep looking into this.

  • Captivate: Using Javascript to show/hide text captions

    Hello,
    I want to show/hide a text caption using javascript. I can't find the way of doing it with advanced actions. I dont know if it's because it belongs to a question slide in a pool. Does somebody knows if it's possible and how it can be done??

    You can set the length of the variable when you insert it.
    15 characters is just the default setting.
    What I meant by COULD is that the kind of thing you are asking about here (using JavaScript to hide objects inside a Captivate movie at runtime) is not as simple as you'd like it to be.
    JavaScript is not my particular area of expertise, but there are some people that chime in on this forum that ARE experts at JS. But I think they would also be the first to say that it's not as simple a thing to pull off as just "knowing the command to hide/show an object".
    The easiest tool to use in Captivate for showing or hiding objects is Advanced Actions.  The next easiest thing to use is ActionScript 3, and that's hard.  JavaScript is a very useful programming language, but it spends all of its life outside the Captivate movie looking in through AS3's External Interface.  So JS alone is not going to solve all your issues.

  • Begin Javascript in Captivate - Doesn't work

    Hello
    I'm a beginner using Javascript in Captivate.
    I tried this :
    I create a new  bouton
    In Action section of Properties Box, I selected "Execute Javascript".
    In the script window, i writed :         alert("I Love Captivate");
    I generated my project in Html
    In the HTML output, the bouton doesn't work.
    Anybody knows why ?
    I'm using Internet explorer.

    You won't have to worry as long as your course content is being delivered from a web server.
    If you were delivering the content from a CD ROM they would need to set their CD ROM drive up as a trusted location.
    If you were delivering from a network LAN, they would need to set that location up too.
    So for what you are trying to do, web delivery is best.

  • Captivate and LMS JavaScript Problem

    We use Captivate and a Plateau LMS. We had an issue with
    bookmarking within our course. The first lesson worked just fine,
    but later lessons were not bookmarking. We added javascript alerts
    to the code to see when the Captivate content was setting LMS
    variables.
    We feared the issue was the bandwidth between the client and
    the LMS was so limited that the script attempting to set the LMS
    variables was failing, but this is not the case. The script appears
    to not run at all sometimes at random intervals. When it does run
    it is successful each time. The first lesson, which works reliably,
    is much smaller than the other lessons, maybe the size of the SWF
    factors into the ability for the script to run properly?
    Has anyone else run across this issue? Does anyone have
    advice in deeper troubleshooting an issue like this?
    Any input is appreciated.
    Thanks!
    Chris

    I think that CP3 sends back its data on a time basis, not a
    slide
    basis...like every 7 seconds or something?
    We've had customers who are tracking interaction data in
    their CP
    quizzes which have like 40 questions. If they go through it
    too quickly,
    the timed 'save' to the LMS gets behind quickly...so by the
    time the
    user is done, only 2/3rds of the suspend data has been
    saved...
    And I imagine the bookmark could be left out entirely as
    well.
    So see if it's a timing thing? Go through slowly, see if
    posting happens
    on a timed basis...maybe that will help determine where the
    issue is...
    I do wonder how CP4 sends its data back...
    Erik
    chrishillman wrote:
    > The script appears to not run at all sometimes at random
    > intervals. When it does run it is successful each time.
    The first lesson,
    > which works reliably, is much smaller than the other
    lessons, maybe the size of
    > the SWF factors into the ability for the script to run
    properly?
    Erik Lord
    http://www.capemedia.net
    Adobe Community Expert - eLearning
    http://www.adobe.com/communities/experts/
    http://www.awaretips.net -
    Authorware Tips!

  • How can I copy Captivate 6.x document array data into a new Javascript array

    I'd like to copy an array from my captivate document variables to a variable within a script my project runs.  I attempted to use objCP.cpEIGetValue("m_VarHandle.Array.slice(0)") but that didnt seem to work.

    One the primary things I learnt at Uni is the Object Oriented Modal of design and Development, MVC etc.
    Seperation of the function, display, data being a fundemental point to develop and all the benifits of that.
    Also, Your HTML code will weigh more, i.e. a web page riddled with similar code will have a kb size that is a lot larger than necessary. The inline script and css will make the source more dense, search engines have to sift through it to find your actual content.
    Your HTML code will never be truely cached but the external dependencies, such as the CSS and JavaScript files, will be cached by the visitor’s web browser after the first visit – this means that instead of loading a lot of superfluous HTML code for every page in your web site the visitor visits, it will quickly retrieve all style and interaction locally from the web browser cache and thus improve perfomance further.
    No fall back interaction, and harder to manage, correct and update along with poor attrinbute accessability. Having your scripting in one central location makes your development time more effecient, working on new aspects of the site has no effect on the live site, functions can be wrote once called many times and only when needed. Object coding in Javascript improves performance, management, use and more also.
    With these in mind the page load is just longer with inline scripting and the event handling is poorer and then coupled with the other elments mentioned above.
    Just better done right BC has runs gzip, you can optimise your code and the server caching of css, script, image files and the browser it just all leads to better perfomance of your site which is also increasingly something google wants to see to rank you well.

  • Using Actionscript or Javascript to unload movie using Captivate 5.5

    I have an application an agency built that houses my training videos (created with Captivate 5.5). Now users can click to start a video and then immediately close it and the application shows that they viewed/completed the entire movie. I need to find a way for Captivate to send a call (or something) to the application telling it that the movie has finished.
    I do not know much Actionscript or Javascript but I am a fast learner. I read in past posts where this was accomplished in Captivate 2.0 and 3.0 by
    1) coping the captivate movie into Flash and adding two lines of code (Actionscript)
    import flash.external.Externalinterface;
    External Interface.addCallback("unload", this, unloanSQF);
    2) the following would be added to the HTML page
    //Detect Flash container movie
    function getFlashMovie(movieName) {
       if (navigator.appName.indexOf("Microsoft") != -1) {
          return window[movieName];
       else {
          return document[movieName];
    //Function to be called by Captivate
    function captivateUnload() {
       //Calls "unload" method established in ExternalInterface Actionscript code
       getFlashMovie("simpleSwfLoader").unload();
    3) Add the Javascript call captivateUnload() to the Captivate button.
    I am hoping that the procedure has gotten better with 5.5; plus I do not want to use a button. I want the unload event to occur automatically when the movie ends. Plus, I can't see how to produce a fla version to be imported and edited in flash.
    Any help or direction would greatly appreciated.
    Thank you, Jim

    It sounds like you will need to change some functionality in the application that launces your Captivate SWF's. Currently they will be set to "completed" once they have been opened. The correct approach would be to have your application set them to "Incomplete" or "In Progress" and then have Captivate execute a JavaScript on the last slide calling a function in your application that sets the module as completed.
    /Michael
    www.cpguru.com - Adobe Captivate Widgets, Tutorials, Tips & Tricks and much more..

  • Can I create a javascript in a captivate advanced action

    Hello all:
    I am just getting the hang of Advanced Actions and I am having trouble trying to utilize the Javascript Window.
    I have three captivate variables v_Var1, v_Var2, and v_Var3.
    I am trying to create a JavaScript function in the Javascript window to concantonate these into one variable  v_AllResponses.
    Is there an example of such a script out there and can you point me to it?
    I have looked but so far no luck.

    You can define a variable to contain a space and use that in your Advanced Action:
    The SPACE variable has a default value of (see screenshot).
    That default value is the HTML for a space character. 
    Not too many people know this, but you can add limited HTML tags to a caption by using Cp variables.  Here are the supported tags:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.ht ml#htmlText
    This opens up a wide range of possibilities for dynamic text formatting of your variables.  For example, using a single text caption, you could change the color of the text to red or green depending on the tags you surround your variable with DURING RUNTIME.
    Jim Leichliter

  • Controlling captivate movie with JavaScript

    Hi,
    I am trying to use Flash methods to control a captivate movie
    using procedures documented in the support center article:
    http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03. html
    I am using the following code in a JavaScript:
    var movie = window.document.Captivate1;
    movie.StopPlay();
    Captivate1 is the object ID assigned by Captivate when it
    generates the HTML file. The movie does not respond to the command.
    I have created my own Flash movie and the StopPlay command
    works with it.
    Thanks in advance for any help anybody can provide!

    Captivate SWFs don't respond like other Flash movies. You can
    use similar techniques, but must use some specific, legacy "control
    variables" that are hanging around since the RoboDemo days:
    To pause a movie, use rdcmndPause = 1;
    A good place to find more details is here:
    http://www.raisingaimee.co.uk/index.php?option=com_content&task=view&id=27&Itemid=29

Maybe you are looking for