Javascript in Captivate 6.1?

I have been unable to get any javascript to work in Captivate. Adding a simple statement to a button on click for instance, none of these variations work:
window.open('http://google.com')
window.open('http://google.com');
window.open("http://google.com")
window.open("http://google.com");
also tried enclosing in:
<script type="text/javascript">
</script>
This simple statement doesn't work when published to a web server. Clicking the button produces the chirp and nothing else. I tried using a button and also a smart shape, neither work. I don't see any documentation explaining any required syntax or special settings. Any help is appreciated.

I tried
window.open("http://www.google.com") in a click box and it worked fine in IE 9, so long as I turned off my pop-up blocker.  Even though I had Current window selected, it popped up a new window (which makes sense with window.open).
Might check your pop-up blocker.
Message was edited by: rgcunningham

Similar Messages

  • 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.

  • Javascript in Captivate 7

    I understand from one of my developers that Captivate 6 has a known bug that causes Javascript inside Captivate to malfunction in IE.  We are doing the scriping in 5.5 for the moment, but I'm wondering if anyone knows if the problem has been fixed in CP7?

    Yes, this has been fixed in Cp 7.
    Jim Leichliter

  • How can I hide a button with javascript in Captivate 8?

    I need to run some javascript in my project and at the same time I want to hide a button, so I can't use advanced actions.

    It is very strange, most users who have focus on JS try to do everything with it, whereas lot of simple actions can easily be done with advanced/shared actions. I will only go to JS when it is not possible with advanced/shared actions.
    You are lucky, I was just restarting to work on an advanced training for next week when your question showed up.

  • Javascript in Captivate 3.0

    Hi,
    I used javascript to create pop-up boxes that link to pdf files. I also used javascript to create pop-up boxes that link to jpg and gif files. The pop-up boxes that are linked to the jpg and gif files work fine on all PCs. However the ones with the pdf links do not work on every PC. The PCs that it doesn't work on does a quick flicker like it will work, but doesn't.
    I think the issue is with the setting on the PC, but not 100% sure what to change. Can anyone tell me how to resolve this issue?
    Thanks.

    You may want to post your JavaScript code so we can see what you're doing.  I'd also make sure the most recent version of Adobe PDF Reader is loaded on those machines.  You may also want to check that the .pdf file type is associated with the Adobe PDF Reader for those PC's.  If there's no file association for .pdf files, the computer won't know how to open them even in the browser.
    Hope that helps,
    Jim Leichliter

  • Javascript in Captivate

    Can javascript be added to a click box to close the window.
    I've tried several scripts that I found online, but none seem to
    work in either Internet Explorer and Firefox. Any ideas?

    Yes,
    You can do so. Open the properties of the click box by double
    clicking it.
    Change the success action to 'Execute JavaScript'
    Click on the '...' button and write your javaScript -
    (window.close(); in our case) - it will show a confirmation box
    before closing IE window.
    This should solve your problem.
    Its important to note that the Execute JavaScript will work
    only when you publish. In preview you may not be able to see the
    correct functionality.
    Also you may have a look at
    this
    post for more details.

  • Captivate 8 - Javascript does not work in runtime

    Hello,
    I have been playing with using javascript within Captivate, testing both Captivate 7 and 8.  Using simple code attached to a smart shape button - three alert statements - , I proceeded to test the javascript in both the preview and run time mode.  here are my results :
    Captivate 7
         HTML5 (preview) - only the last alert statement executes    
         HTML5 (published, runtime) - only the last alert statement executes   
         SWF (preview) - all three statements execute      : )
         SWF (published, runtime) - none of the three execute  
    Captivate 8
         HTML5 (preview) - only the last alert statement executes 
         HTML5 (published, runtime) - only the last alert statement executes
         SWF (preview) -none of the three execute
         SWF (published, runtime) - none of the three execute
    Can someone help me out with this?  I would like to my javascript to work in the published versions of both SWF and HTML5 for at least Captivate 8....
    Thank you!

    Hi Rscharfer,
    As the alert dialog box for HTML5 captivate is not modal, the javascript will not pause after executing the first alert, hence what is happening in your case is that all the three alerts are printed one by one over each other and you are just able to see the last one. when you click on the last one the click goes to all the alerts and closes them all.
    try this one, put this script on javascript execute action on a button.
    setTimeout(function(){alert('Hello')},300);
    setTimeout(function(){alert('Shriyansh')},10000);
    setTimeout(function(){alert('Agnihotri')},30000);
    The above script will prove you that all the three are executed and you will get all the 3 alert boxes one after other with intervals as 300ms,10secs and 30 secs.
    Let me know if there are queries on this.
    Thanks and Regards
    Shriyansh
    Adobe Engineering Team.

  • 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

  • Want to stay on same slide after button click - Captivate 5

    I've got a button I'm using to pop up a separate browser window for a glossary. I need this button on every page of the module. I've got click boxes to control the flow of the timeline from page to page. When the user clicks the glossary, he should stay on the current page, get his information and dismiss the glossary. When I run it, the timeline pauses for the button, and if the user clicks it, the timeline progresses to the pause for the click box, still on the same page. But if the user clicks again on the button, the pop up window works, but Captivate moves on to the next page. Is there any way to prevent this, so that a user could click any number of times on the button without having the timeline progress past that page?
    Thanks for any help anyone can provide.

    Hi DS,
    I use a javascript call to do what you describe all the time.
    Since I use this all the time I embed the actual full javascript in Captivate's "standard.js" file. This is the full script:
    function openBrWindow(theURL,winName,features)
       window.open(theURL,winName,features);
    I save the standard.js file. On my workstation this is the path to that file:
    C:\Program Files\Adobe\Adobe Captivate 5\Templates\Publish\standard.js
    Now I can call the script anytime.
    Here's how I configure the click-box:
    If you look at Rick's picture (thanks Rick) in the Properties control menu under Action, for On Success, choose Execute Javascript.
    Next Click the Script Window button, this opens up a blank window. Since you are just calling the javascript, you don't need to put the whole script in the window. Here is an example:
    javascript:openBrWindow('myURL.html','thewindowname','height=800px,width=1000px,scrollbars =yes');
    Ths example opens a window 800px tall and 1000 px wide with scrollbars. You can add additional attributes if you like. Make sure the URL is correct and has the correct path and if you have more that one of these on a slide the window name will need to be different. (If this persists from slide to slide you don't have to have them all as unique, only for more than one on a slide.
    Now, click the little down arrow beside the Script Window button. This produces a little drop menu (as illustrated on Rick's image). Make sure you select "Top" and turn off the "Continue Playing the Project".
    This control makes the newly spawned window appear on the top of the project and stops the playing of the slide. You can set other options in Properties to turn off or on captions as needed.
    I hope this helps,
    TPK

  • Javascript alert boxes?

    I'm looking to incorporate an alert box which launches when a
    user clicks on exit to confirm the click. Is there an easy way to
    do this within Captivate 2's "execute javascript" command?

    In general, you can close a window with JavaScript but my
    understanding is that it can't be done at all in Firefox 2.x unless
    the window you're trying to close was originally created using
    JavaScript. This would be a deal-breaker for most general-purpose
    solutions.
    If you're sure you only have to deal with IE, then there are
    some ideas in
    this discussion
    thread that might work for you.
    When testing such solutions, it's a good idea to run your
    files from the environment they will ultimately be accessed from
    (i.e., a Web server). Unless you monkey with your IE security
    settings, running JavaScript-enhanced Captivate files from the
    local machine will result in false negatives due to browser
    security restrictions.

  • Accessing c4 Variables in Javascript

    How do you pass a Captivate 4 variable (User or System) in Javascript when the published .SWF is embedded in another tool like Lectora or Flash?
    In Captivate, you can set a value into a Lectora variable (VARmyLectoraVariable.set('myvalue');, but I don't know how to access the Captivate variable.
    When run from Captivate, this works:
    Captivate.GetVariable('CaptivateVariable');
    But when the published .swf from Captivate is inserted into Lectora and run, I get a JavaScript error ('Captivate' is undefined).
    How do you reference the Captivate variable in JavaScript when the .swf is not embedded in the Captivate project html file?
    Thank you!

    http://pipwerks.com/journal/2009/06/07/introducing-the-captivatecontroller/
    check this out

  • Referencing Captivate (quiz) variables

    Hi folks - we are using our own software to function as a lite-LMS and looking to use javascript to pass data back into our custom reports for both tracking and quizzing.
    We have been able to GET data from Service-now using client scripting and executing JS in Captivate. So for example, we can query course info and get the logged in user (student) and render that in the captivate project.
    We also figured out how to make javascript calls to move data from the running captivate project to the Service-now.com instance as well.
    The last remaining piece of the puzzle is accessing the quiz variables from javascript running within the published SWF file: how to access a variable from a caption (using tokens: $$cpQuizInfoPassFail$$), so the questions are as follows:
    1.       What’s the best way to reference the Captivate variables when running Javascript from Captivate (using ‘execute JavaScript’ action)?
    2.       Are the quiz variables accessible in slides following the quiz results? (The quiz results page doesn’t let me add another button to publish results using Javascript)
    Thanks in advance!
    jon

    Hi there,
    For information on using JavaScript with Adobe Captivate you might want to tak a look at the two links I have included below.
    Thoughts on using JavaScript with Adobe Captivate:Screen shots show Adobe Captivate screens
    JS Controller for Adobe Captivate 5
    Best regards,
    Mark

  • What event fires when a captivate ends?

    Hello,
    I'm a web app developer and I'm working with Captivate. I'm not a captivate designer myself, just a programmer, so I don't know the first thing about Captivate (though I'm working with someone who does). I'm wonder if there's an event that fires when the captivate is done--that is, when the user clicks on the "submit" button on the last slide after which there is nothing more for the captivate to do.
    My friend the Captivate designer says the submit button is wired up to an event handler in the CPM.js file. The script is named "assessment_Pass" and we've located the event handler in CPM.js. However, I can't work with this. I can't manually manipulate minimized javascript that Captivate generates, especially when we've got hundreds of captivate files and keep getting updated. I need to work in the javascript in my Visual Studios project. If I could know what event fires (if an event fires) when the captivate is done, I can then wire it up to a javascript event handler in my development environment.
    I found this list of Captivate events (they're actually for the Captivate API Interface, which I'd prefer to work with, but any event will do), but none of the one's I tried seem to fire.
    Any help is much appreciated.

    [quote="elearning_dude"]Events are exposed only for interactive objects (buttons, button smartshapes, etc.) and ON_SLIDE_ENTER and ON_SLIDE_EXIT (the latter of which actually fires on the first frame of the *following* slide, unless it's been fixed in Cp8). [/quote]
    Well, it's a submit button on the captivate that's supposed to fire the event. Is that an interactive object?
    [quote="TLCMediaDesign"]Maybe if you explained what you are trying to accomplish I could point you in the right direction. Maybe you could use the CPAPI_MOVIESTOP or CPAPI_VARIABLEVALUECHANGED events and check if on the last slide.[/quote]
    I would like to know when the captivate ends (i.e. when the user has gone through all the slides and has clicked the submit button) and to do some processing in javascript afterwards (essentially, calculate the user's score and figure out whether they passed or failed).
    I'm trying the CPAPI_VARIABLEVALUECHANGED event on a captivate variable called "result". My friend the Captivate designer says that when the user clicks the last submit button, a script is run to change the value of this variable. When it changes, this event should be fired and I should be able to catch it, no?
    I'm doing it like this:
    _captivateWindow.cpAPIEventEmitter.addEventListener("CPAPI_VARIABLEVALUECHANGED", "result", ResultChanged);
    var ResultChanged = function()
    alert("hello");
    but I'm not getting my hello message.
    I will try the timer idea that andreleal suggested and get back to you.

  • Can you open multiple files using an advanced action?

    I have either Captivate 5.5 or Captivate 7 to work with. Currently my project is in 5.5.
    I have a button that I want to open three PDF files. I created an advanced action, selecting Open a new file/URL and selected the file name. Currently they are set to open in a new window.
    When I test the button, only one file opens.
    If I set one to open in a new window and another to open in the top window, I lose the course but get two to open.
    Is there a way for me to open each of these files in a new window using the same button?

    You could do it by executing javascript:
    in Captivate: open_win()
    add this to the head section of your html page that loads the captivate object:
    <script type="text/javascript">
    function open_win()
         var url1 =" http://www.google.com";
         var url2 =" http://www.yahoo.com";
         var url3 =" http://www.bing.com";
         window.open(url1);
         window.open(url2);
         window.open(url3);
    </script>

  • Navigation Confirmation Headache

    Hi,
    I've been working on a CBT for a few days now and I'm finding
    Captivate 2 very intuitive and pretty easy to use, all apart from
    one aspect - complex navigation.
    Until now, I've had a fairly linear solution, whereby I have
    an entry screen, followed by a title/menu screen from which the
    user can select which part of the training program they wish to
    view.
    Each part is then a series of slides, and at the end it goes
    back to the menu. Easy
    However, now I wish to add a button at the bottom of each
    slide to allow the user to return to the main title/menu screen at
    any time during their training (say if they picked the wrong item
    on the menu, for example), but I also want to include a
    confirmation so the user doesn't inadvertantly click the button and
    is whisked away from their training.
    I've tried making a single slide with "are you sure?" and
    YES, NO buttons. The Yes button is easy - Jump to Slide: Title.
    However, when I came to the NO button, I was stumped. "Previous
    Slide" will take me to the previous slide in the whole line of
    slides, rather than the previous slide the user was on, so if I
    wanted to do it this way, I'd need a confirmation slide after EVERY
    SLIDE so that the previous slide would be the slide it came from...
    This is infeasable due to space and production time, so I
    tried using Javascript - but how can I do this? No-where in the
    help or online can I find a similar problem, and as far as I know
    there's no help available on the use of javascript in Captivate 2,
    in the manual it just says "select this option to run a specific
    piece of JavaScript code." So what would the commands be for "go to
    the slide you were last on" or even "bring up a window.confirm()
    and if yes go to title, else stay put"? I've been trying for a
    while, and I was wondering if someone out there would be able to
    help..
    My main concern is that no-one else seems to have had this
    problem, which says to me I'm just being silly and I've missed
    something obvious... If this is the case, please let me know!!
    Sorry it's so long, but at least this way I (hopefully) won't
    have to explain myself any further!
    I look forward to hearing your replies, thank you
    Oli

    Thank you Rick, you've been an immense help. I tried
    everything you said and none of it worked even in the slightest - I
    was extremely upset, angry, disappointed, depressed, impassive,
    confused and finally down right hungry (in that order).
    So I went to have some lunch, then got back and worked on
    something else for a bit.
    Finally, I summoned up the courage to give it another look. I
    re-read what you'd said, I started again, FROM SCRATCH with a blank
    document; nothing but a big, frikkin massive button on it (you can
    see this here:
    www.scree.co.uk/annoyingCaptivateWork/test.htm).
    I even got rid of the window.close() and just put a damn javascript
    alert in there - how more basic can you get?
    Fingers crossed, I would've been praying to some God or other
    if I was of the religious type. Perhaps, in a way, I was praying to
    the God of
    Insanely-Uncomplicated-But-Annoyingly-Unfathomably-Incorrect code.
    Either way, I couldn't believe it when it still didn't work!!
    "What's going on?" You may be asking yourself. "I thought he
    was thanking me... Or perhaps that was that damn Sarcasm I've heard
    of - it'll never catch on you know".
    So I will put your mind at rest this minute and say you WERE
    right, Rick. As right as you possibly could be. It was my own lack
    of sense, or possibly my own blind belief that "surely anything
    that'll run on a website will run off my desktop.. right?" which
    got me in to this trouble and confusion.
    I was preparing to write back and say I'd tried everything
    you suggested and still couldn't make it work. I had prepared (in
    my head) a small step by step portrait of how my day had gone from
    bad (I had to get out of bed) to slightly worse (no milk) to even
    worse (my train was delayed) to bloody aweful (damn Captivate),
    with annotations and small diagrams and numbered flow charts of
    what I'd done and how I thought I couldn't possibly have failed to
    come across the right answer by now through SHEER CHANCE if not
    through reason.
    I had just got to the point where I was uploading the
    test.htm file to a website so I could link it to you to show you
    that I had indeed followed the teachings of Rick the Captiv8r when
    suddenly.. inexplicably.. IT WORKED!!! IT BLOODY WORKED!!
    All along I'd been running the thing from the folder it had
    been published too, to no avail. All I had to do was copy it into
    my local web root directory and run it online and all my problems
    would've been solved half a day ago.
    Thank you so very much for all your help. If you don't mind
    too much I'll continue to use your example from earlier to help me
    get started on pausing and switching slides etc.
    To sum up, for those of you who really can't be bothered to
    read everything up there: Javascript buttons in flash files made by
    Captivate seem to only work when accessed through a webserver, not
    through the file system.
    If anyone can think of any reason why this would be the case,
    I would love to know. Thank you again - I'd better get on with the
    CBT now
    Oli

Maybe you are looking for

  • Is it possible to copy the same database multiple times simultaneously?

    This is the setup of my environment. I have a 'master' database that contains the full schema plus some pre-populated data such as default settings. When database schema changes are made, they get made to the master database. When a new customer sign

  • How do I get updates to my Firefox

    When I log into QuickBooks, it tells me I am not using the updated version of Firefox. How do I check to see what is missing from my site.

  • Runtime embeding in SWF

    Hi, I m in process of developing a website which required to save the customized video, I want to know if there is any possibe way to embedd the audio and image in the swf in runtime so that it can be rendered to a video format via some 3rd party swf

  • Personalize Button to be restricted for a user

    Hi All, My issue is when a user  login to WEBUI  he/she must not be able to see the personalize Button. To restrict  the personalize button is there any SPRO Configuration or we have to do through the code? Thanks & Regards, Venkat

  • Copying files into site

    How can I create an extension that when added automatically adds a required file/folder to the current dreamweaver website? I've seen other extensions add javascript and .gif files and folders but I cannot find any tutorials on how to do this. Exampl