Captivate Buttons with JavaScript

At my place of employment, we use Adobe Captivate to create
demonstrational tutorials for our software system. We are currently
looking into adding a screen at the end of each of our tutorials
that includes buttons to either watch the tutorial again ("Watch
Again") or close the browser window ("Close This Screen")...
Through Captivate's buttons we can easily create the "Watch
Again" button by setting the button properties to...
- If the user clicks on the button...
--> On Success: Jump to Slide
----> Slide 1
However, I am having some difficulties with the "Close this
Screen" option. I currently have things set up so that the browser
window is closed through JavaScript, which works fine. This is
achieved through the following button properties settings...
- If the user clicks on the button...
--> On Success: Execute JavaScript
----> JavaScript:window.close();
The only problem I'm running into is that when I click the
"Close this Window" button in the published SWF file in an Internet
Explorer window, I receive an IE pop-up message that says...
"The webpage you are viewing is trying to close the window.
Do you want to close this window?", with Yes and No options.
If possible, I'd like to be able to bypass this message. Does
anyone have any clue as to whether this is possible, and if so, how
to do it through Captivate?
On another forum (
http://www.trap17.com/index.php/javascript-close-window_t29518.html),
it looks like I may have found a solution, but I'm not sure how to
format/translate the language so that Captivate can understand it
and execute without error. My attempts thus far have been
unsuccessful. Here is the code that I believe SHOULD work, which
calls out a pre-defined JavaScript function...
function NoConfirm ()
win = top;
win.opener = top;
win.close ();
JavaScript:NoConfirm();
As I've said; however, this gives an IE error message when I
run the output and the close function completely ceases to work.
Again, does anyone have any ideas...?
Thank you in advance.
--Daniel

One of the problems is that IE/Windows will give you a
security warning when you try to close a browser window from
another object. The basic rule is, a command from JavaScript to
Javascript will close without a security warning. Therefore, you
must place the Javascript code - a function - out in your HTML
page. It just sits there - and then within Captivate - you call
that function - and it executes - without an error message :) Note
- the code below works flawlessly - but depending on your system -
i.e. in IE - you might receive a warning for running JavaScript.
You need to run it from a web server from a
http:// address to make this work 100% with no
user actions required.
Here's the code I use:
HTML Page (you can place this in your standard.htm file, so
that it's placed in your HTML pages each time you publish). This
code should be placed within the <head> </head> tags of
your html page (you can use Notepad to edit).
<!-- Javascript below called from Captivate to close the
browser window.
Code created by
http://www.kcwebplaza.com/captivate
-->
<script type="text/JavaScript">
<!--
if(window.parent!=window)
window.close = function()
window.parent.close();
//-->
</script>
Captivate Movie
In your Captivate button properties, select On Success >
Execute Javascript. Click the ... button, and place this inside the
dialog:
window.close()
Good luck!
Todd

Similar Messages

  • Button with Javascript appearance changed.

    Hi,
    I created button with javascript from
    Re: Button and Function
    Everything works fine, But button looks different now
    No appearance of button is there & button label is displayed in orange color.
    Have i missed something or i will never like original.

    I have done some changes suggested by ATD for another thread.
    In your app, through Shared Components, Templates create a new button template based on a copy of an existing one (pick whichever existing template you prefer, the normal Button may be ok). When the new template is created, edit it. You should see something like the following in the "Template" setting:
    a href="#LINK#" class="t12Button" #BUTTON_ATTRIBUTES#>#LABEL#</a
    There may be other HTML around this, but this is the important part as it is the actual button itself. Change this to:
    a href="#" class="t12Button" #BUTTON_ATTRIBUTES#>#LABEL#</a
    Now, on your button on the page, change it to use your new button template. In the Button Attributes setting, add in:
    onclick="javascript:checkText();"
    everything works fine except appearance of button.
    Edited by: TEJU on Jun 4, 2009 10:21 AM
    Edited by: TEJU on Jun 4, 2009 10:22 AM
    Edited by: TEJU on Jun 4, 2009 10:24 AM

  • How to add a button with Javascript to Library

    Hi
    I am using Captivate 5.5 to create a template.
    In the files which will be created using this template, we will be adding a button which executes a Javascript. Now, my question is, since this button will be used on multiple slides in the file, can I add this button (with the Javascript) to the library? Currently, we create it manually everytime.
    We don't have a programmer in our team, so we can't create widget. Is there an alternative way?
    Thanks for your help.
    Sreekanth

    Thanks for that reply.
    I now have a blank slide with the button (including the javascript) on it which solves the problem of importing it manually.
    However, when we use this template to import PowerPoint presentations, when we publish the file, the first slide (the one on which I have this button) will be blank and has to be manually deleted.
    Is there a way to eliminate this manual work? I tried hiding and using some actions. But it was not of any use.

  • Html db confirmation button with javascript:

    Hello,
    First, I have a button with a URL javascript:confirmAction(document.forms[ wwv_flow ].elements[ P181_MESSAGE_CANCEL ].value, Cancel);
    In this moment, by pressing on "CANCEL" button, a pop-up with the message of field (P181_MESSAGE_CANCEL) appears and there is a connection towards the same current page with the starting values. I want to make a validation, because if no field were modified, then I do not want whom the message posts by pressing on the "CANCEL" button but that the connection is carried out normally.
    Second, I would like that if one modifies a field in a page and that while pressing on a mitre to move on another page, that it is a message in pop-up there "Want you to really change page without recording your modifications? "
    Thank you very much!

    Do you mean a close button in HTMLDB or the browser window's close button? [HTMLDB cannot help much with the latter!]
    For buttons you created, just add a URL target as
    javascript:if(confirm("Are you sure?")) doSubmit('CLOSE');
    That will popup the box and if OK is clicked submit the page with REQUEST set to CLOSE

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

  • 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

  • Captivate button with HTML form action

    Hello,
    How would I create a button in Captivate 6.0 that would perform the following action below?
    <form method="post" action="https://suppliers.company.com/tracker/reg/CourseReg.cfm">
    <input name="submit" type="submit" value="Receive Credit">
    <input name="CourseId" type="hidden" value="TR001234">
    </form>
    I though it would be simple, but not sure what to use. If it should be vaiables, advance actions or javascript?
    thanks!

    You havent closed these two tags
    Sex :
    <html:radio property="sex" value="M">Male
    <html:radio property="sex" value="F">Female<br>ram.

  • Button with javascript

    I am trying to create a button that will call JavaScript function. Something like delete button - when user presses it he receives a JavaScript alert message. I am sure it could be done but I couldn't find it in documentation.

    Robert, you can modify this function to your needs and include it in a .js file that is included in you page template. Do NOT modify /images/javascript/core.js or functions.js as these files will likely change with each upgrade, thus over-writing your changes.
    function confirmIt(msg)
    var confIt = msg;
    if(confIt ==null)
    confIt= confirm("Would you like to perform this action?");
    else
    confIt= confirm(msg);
    if (confIt== true)
    // The following line will set the value of request to "Confirmed",
    // you can use any value you wish, then reference this value
    // for conditional logic such as processes or branches
    doSubmit('Confirmed');
    }

  • How to create a button with javascript

    Hello everyone ,
    I'm pretty new in the world fo APEX , after reading a lot of tutorials , i'm trying to build my own application ,but now i'm stuck because of my lack of knowledge :)
    So here is the problem ,
    I have a line with a select list ( designed to select a task )+ 5 text fields ( designed to write how many hours the worker worked each day for the task )
    And then , a button " Add Task " , so with this button i want to create a copy of the first line so the worker can add an other task , but actually i have no idee how to do this .. I don't know if i was clear or not ? ,
    I will apreciated all advice and remarks ,
    Thanks in advance
    Brice

    Once your tabular form is created,
    go to Report Attributes and click the edit icon(pencil image) next to the column you want to be a select list,
    go to column attributes and click the Display As select list, and you'd probably choose Select List Static or Named
    The Add Task button would be the standard 'Add Row' button that gets created from creation of the tabular form.
    What do the rows that you want to create relate to? It seems that the first row has a Task coming from the select list and the 5 entry columns as hours each working day of week and one week = one row ?
    If you need to create additional blank rows, I would look at using an Apex Collection, created in a before header process, where you can add as many rows as desired, then query the collection for the tabular form, and maybe have a custom post submit process to update the collection data to your table. If you're only adding rows to the table, you don't really need the checksum functionality that is a desirable part of the Apex Tabular Form/MRU process. Thinking out loud here.
    Hope this helps.
    Edited by: Bob37 on Nov 9, 2011 10:40 AM

  • Radio button with javascript - - Please HeLP !

    Hi,
    I have the following code
    My question is:-
    Q : Clicking on Submit button. gives a javascript
    message "Please make a selection" even though when I selected a radio button
         I have haspmap which displays possible answers to a question in a radiobutton type. When submit is prssed, I like to check whether a selection is made or not. and if not, I want a message shown. And when selected. I want page to prcede to processSurveyInfo.do
    Please help
    <script language="javascript">
    function checkRBtn()
         var name = document.forms[getNetuiTagName("studentmultpChcform", this)][getNetuiTagName("rbtn", this)].value;
         if ((name==null) || (name=="Undefined")) {
         alert("Please make a selection");}
         else {
         document.forms[getNetuiTagName("studentmultpChcform", this)].method="POST";
         document.forms[getNetuiTagName('studentmultpChcform', this)].action="<netui:rewriteURL URL="/TrainingActivity/Administration/SurveyFile/processSurveyInfo.do" />";
         document.forms[getNetuiTagName("studentmultpChcform", this)].submit(); }
    </script>
    <table align="center">
    <tr>
    <td>
    <netui:button value="Next-->" type="submit" styleClass="commonButtons" onClick="checkRBtn(); return false;" tagId="nq"/> </td>
    <td>
    <netui:button value="Finish" tagId="finbtn" action="fwdfinish"/> </td>
    </tr>
    </table>
    <table align="center">
    <tr>
    <td>
    <netui:button value="Next-->" type="submit" styleClass="commonButtons" onClick="checkRBtn(); return false;" tagId="nq"/> </td>
    <td>
    <netui:button value="Finish" tagId="finbtn" action="fwdfinish"/> </td>
    </tr>
    </table>
    please help me out.
    Thanks
    -Raza-

    You need to write a custom script and it's location will depend upon when you want the script to execute.
    Radio Buttons and Check Boxes have a string value of "Off" when none have been selected and take the value assigned to the field when checked.

  • Printing PDF attachments with Javascript?

    I am very new to Javascript (and not a programmer) so please excuse my basic or un-correct terminology here! I've created an interactive pdf, and have set buttons (with javascript code) to print specific ranges of pages from the document. I've now been asked to have said buttons print attachments (which are also pdf's) in the same style... is this possible, and if so, does anyone have example code? The code that I used to print the page ranges, for example:
    print ({nStart: 0, nEnd: 5});
    Any assistance/guidance/help would be greatly appreciated!

    The document first has to be opened. You can do this via JavaScript with the doc.openDataObject method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.509.html
    This method returns a doc object, which you can use with the print method to print the document. You should then use the closeDoc method to close the document, as mentioned in and demonstrated in the documentation linked to above.

  • Associating two events with submit button using  javascript in jsp

    Hi
    How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

    Have something like :
    <input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
    You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

  • Captivate Not Handling PNG-24 Buttons with Transparency

    I've got a problem with the way Cp 5 is handling transparency in PNG 24 images:
    I've created a button from a Photoshop CS5 comp that has a drop shadow effect.  When I insert the HelpButton_up image as an image in Captivate, the transparency works great.  When the exact same image is used in a button, I get the white halo effect on the button.  Can anyone shed some light on this?  What are the best settings to use in Photoshop to preserve drop shadow transparency in buttons?  I used "Save for web and devices" and used the PNG-24 setting with Transparency checked and Interlacing unchecked.
    Much appreciated!
    Jim Leichliter

    Hi Jim,
    I don't know where the buttons are cached, but I have had my fair share of problems with PNG images and Captivate 5 as well. The new project approach worked for me as well, but it's pretty annoying ;o)
    /Michael
    Visit my Captivate blog with tips & tricks, tutorials and Widgets.

  • New browser window with javascript

    Hello,
    I'm trying to accomplish something similar to what has been
    discussed in other threads (Jess Learnin, 9/30/2008, and another
    thread from back in '07). I've tried the advice given in these
    threads and have had no luck. I would like to create a button to
    call a new browser window that displays a URL of my choosing. I'd
    like to specify the size and attributes of the new window. I've
    created a small dummy tutorial in order to work on this feature.
    I'm using the "Execute Javascript" option when configuring
    the button. I include the following javascript:
    window.open('
    http://lib.berkeley.edu/BIOS/index.html',
    'myWindow','height=400, width=700, toolbar=no');
    I have the Captivate button context set to "Current". I have
    deselected "Continue Playing Project" (though I've tried it with
    that option selected as well).
    I've tried prefacing the script w/
    "javascript:window.open...", but no luck.
    I'm testing the file on a development server, rather than
    from a local copy. When I test in Firefox, my movie simply stops
    when I click the button, without opening a new window or loading a
    web page. When I test in IE7, the movie stops and I get a message,
    "Error on page"; still no new window.
    I do notice that I'm currently running Flash Player 10. I'm
    using Captivate 3. When I publish my file, my options only go up to
    Flash Player 9, which is what I have chosen. I don't know if this
    would make a difference.
    I have also tried altering the standard.js file in the manner
    that jbradley88 suggested in the 9/30/08 thread, and using the
    corresponding javascript in the button properties window, with
    similar unsuccessful results.
    I have tried running the movie on a different computer, in
    case some local setting was somehow mucking things up. I get
    nothing.
    Any suggestions? If anyone's willing to take a look, I can
    send along my small dummy .cp file that I've been working on.
    Thanks in advance.
    -Kelly

    Hi John,
    Here's the exact javascript that I currently have associated
    with the button:
    void(window.open('
    http://lib.berkeley.edu/BIOS/index.html',
    'myWindow','height=400, width=700, toolbar=no'));
    I've tried multiple permutations, including placing
    "javascript:" in front of the script, both with and without the
    void().
    The message in IE7 just says "Error on page". It's not a
    pop-up message; it's just the small message that appears at the
    bottom left of the browser window in IE7 when a page fails to load
    properly. The message doesn't appear until I click on the button
    that's supposed to call the javascript. There's a yellow
    exclamation point icon that appears next to the "Error on page"
    message. When I click on that I get:
    "Problems with this Web page might prevent it from being
    displayed properly or functioning properly. In the future, you can
    display this message by double-clicking the warning icon displayed
    in the status bar."
    It also displays a pointer to the error:
    Line: 1
    Char: 111
    Error: Syntax error
    Code: 0
    URL:
    http://library11.berkeley.edu/bios/kelly/Practice_demo.htm
    I looked at the source for the page as displayed by IE7 (have
    also looked at the .htm and .js files generated by Captivate) and
    haven't seen anything obvious, but I'm somewhat unschooled in such
    matters.
    If it would help to see what it does, you can view the demo
    at the URL above.
    Thx again,
    Kelly

  • Captivate 6.1 Javascript bug / subscription edition

    Hello all,
    I'm working on a SCORM 1.2 compatible eLearning project on Captivate 6.1.0.319 (subscription edition), and I've just come across the bug described very precisely here:
    http://www.youtube.com/watch?v=Vq9K9lvq-5I
    and here:
    http://www.cpguru.com/warning-adobe-captivate-6-and-javascript-bug/
    Basically, any javascript used in the project would break the SCORM compatibility, either sending wrong completion information to the system, or in my case, also shutting down the eLearning module and also closing the window. This problem occurs only in IE, as other browsers seem to work fine.
    My target group of users is a corporate environment, in which IE is the #1 platform; it's unrealistic to ask for a browser update, so I have to find a solution to be able to publish the project correctly. The same blogger who uncovered the problem wrote that it's possible to receive a patch from Adobe which consists of an updated version of the file Mainmovie.swc to swap in one of the program's directories (more info here: http://www.cpguru.com/fix-for-the-adobe-captivate-6-javascript-bug/ ).
    The problem is that the supposed fix (which you have to request via email and it's not directly downloadable), is said to be available only for Captivate 6.0.xx and not for the 6.1 Subscription edition.
    As my project contains a lot of drag and drop interaction, I cannot afford to downgrade to 6.0 to try to use the patch, and I was wondering if somebody has had the same problem and can help out.
    In detail, I only use javascript in one slide to simulate a random display of rollover images (a button calculates the current position of the playhead and jumps to a random point of the slide, chosen from an array of predefined frame numbers; at every 'stop' there is a different rollover image and a button that makes the playhead jump again to display another 'random' image).
    I was wondering if there is any way to reproduce this behavior not using javascript, so that if there is no fix (I'm obviously in a very tight deadline...), I can get around the problem by avoiding javascript altogether.
    Thank you very much for your help!
    n

    You can open 6.1 files in Cp version 6.01.  So that IS an option, though albeit probably not a very palatable one if you've just upgraded everyone around you to 6.1.
    If your main reason for developing in 6.1 was the drag and drop interactions, you may not have been aware that there have been AS3 widgets available to do drag and drop in Captivate since version 4.  Those widgets are also now compatible with all Cp versions up to and including 6.01 and 6.1.
    More information here:
    http://www.infosemantics.com.au/adobe-captivate-widgets/drag-and-drop/which-adobe-drag-and -drag-and-drop-widget-comparison
    Free trial versions downloadable here:
    http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets

Maybe you are looking for

  • Need some help in writing a function

    Hi all, I need to write a function.... the data in a table is of varchar2 type and its a ,separated values. its in many forms sample ex:1,2,3,4,,,,,76, 12,32,,,,,,,, 12,32 12,,,,,23,,,, the total numbers in that field must be 10. So i need to write s

  • DVD Player not reading CD or DVD

    I have a Satellite A665-56093 laptop, and the DVD/CD player was working, and now it won't read CD's or DVD's. The model  on the drive (according to device manager) is TSSTcorp CDDVDW TS-L633Y. When I put a CD or DVD in you can hear the computer tryin

  • Dequeue Condition for Message Payload

    Hi experts , My requirement is that :I have 2 Composites in my Application which are going to listen same Aqueue but I want SubComposite1 to dequeue only message where "LocalName" is "Create" . SubComposite2 to dequeue only message where "LocalName"

  • Adjust brightness of iMac as 2nd monitor

    I have a 2012 MacBook Air plugged into an older iMac via mini Display port cable. (Not thunderbolt). How can I adjust the brightness of the iMac? The Displays system prefs doesn't have a brightness slider for the iMac screen. And the brightness keys

  • Service product not copied automatically from contract

    hi i'm creating a notification referencing a contract item   and thereafter creating a service order from the notification. i'm finding that in some cases the material corresponding to the contract item is getting copied in the service product of ser