Web Object..how to advance

I created a software sim in Captivate 5.5 and I want to insert it into Storyline as a web object that the users have to watch, so I need to remove all navigation from the skin.

Now, when the sim ends everything just stops and remains on the last page of the sim.  Am I missing something?  Is there any way to get that sim to advance when it's finished?  Or put some type of a button on the last page of the sim that could some how branch me  to the next slide in Storyline?

I'm thinking this cannot be done, has anyone done something like this before?

29 Replies
Gerry Wasiluk

Web objects are by their nature independent from the Storyline content.  The web object cannot normally "talk "to the Storyline content.   (Though I wonder--Steve Flowers are you out there?--if something could be done with Javascript here . . . )

Jeanette has a nice demo here where she shows how to do something with an inserted movie that a web object.

Yes, one option is to add a button.  You could do something like figure out the shortest time it takes to complete the simulation and then not have the button appear until then using the timeline.

Steve Flowers

You could use JavaScript to bridge the components using a trigger. Here's a pseudo context:

1) You create a text variable in Storyline called goNext.

2) You create a trigger in your master slide or on the slide where you want to pick up a change in this variable. When variable changes "goNext" jump to the next slide.

3) From your Captivate presentation, generate a JavaScript link (not too familiar with Captivate, though I know this is probably possible) to reference like this:

var player=parent.GetPlayer();

var currentTime = new Date();

var uniqueTime=currentTime.getTime();

player.SetVar("goNext",uniqueTime);

This is one method to trigger your "listener trigger" within SL with a unique value every time.

Gerry Wasiluk

Just thought of another option that could work for some. . .

If you have just a bit of room on the slide, insert a freeform interaction or non-grading quiz question at the bottom of the screen.  Make the answer something that happens or is revealed at the end of the sim. 

If they the answer correctly, Storyline moves them on.  If not, they can watch the sim again and try the question again.

Gerry Wasiluk

Steve Flowers said:

You could use JavaScript to bridge the components using a trigger. Here's a pseudo context:

1) You create a text variable in Storyline called goNext.

2) You create a trigger in your master slide or on the slide where you want to pick up a change in this variable. When variable changes "goNext" jump to the next slide.

3) From your Captivate presentation, generate a JavaScript link (not too familiar with Captivate, though I know this is probably possible) to reference like this:

var player=parent.GetPlayer();

var currentTime = new Date();

var uniqueTime=currentTime.getTime();

player.SetVar("goNext",uniqueTime);

This is one method to trigger your "listener trigger" within SL with a unique value every time.

Thanks, Steve!
J P

Hi Steve,

I'm new to Storyline but I want to try your JavaScript idea. I know how to create the button you're talking about in Captivate, but I don't know how to do what I need to do in SL.

I'm assuming that I put a triggger related to the goNext variable on the page I want the Captivate piece to go to, is that correct?  If so, what is that trigger, what do I need to do?

Thanks for the help.  I'm enjoying SL, but still learning. I'm used to Advanced Actions in Captivate so I'm a little lost right now.

Janelle

Laura Ingle

Hi Steve,

I'm working with a Web Object in SL2. It's an interactive Web Object - a quiz type. So, could this Javascript be set to a True or False value? Instead of based on time. 

Could I apply javascript to a button/link in the Web Object file to set the variable "goNext" to "true" when the user gets to the end of the quiz. Then SL can listen for that variable change and activate the Next button. I'd have a variable in SL called goNext set at default of "false" then when it changes to "true" my Next button is triggered. Will this work? 

var player=parent.GetPlayer();

player.SetVar("goNext",true);

Laura Ingle

Got it to work!! YAY!

However, this didn't work on the player's Next button. I had to put a button on the slide and hide it until the variable was changed. But that works for me! Not sure why the Next button wouldn't work though. Could it be because it is part of the built in player of Storyline?

Thanks  so much for your help! :)

Steve Flowers

Looks like your web object is outside of the domain of the deployed package, correct? You'll probably want to use postmessage instead of parent in this case. When web objects are embedded, most of the time you shouldn't run into trouble referencing parent.

http://javascript.info/tutorial/cross-window-messaging-with-postmessage

Cross domain comms is more complicated to implement but postmessage is reliable. Should fix the problem.

Lisa Anderson

Laura and Steve,...thank you for this possible fix. I realize it's been some time and wondering if you might still be able to offer assistance.  

I have a web object (created and saved in SL2) inserted into my main SL2 file. The web object contains a submit button, which has it's own java script trigger to save a document to their desktop, when clicked. When the submit button is clicked, I'd like it to change a t/f variable in the main SL2 file that it has been inserted into, so that the main SL2 file player's next button becomes active and the user can advance from the web object slide to the next slide in the main SL2 file.

Where does the variable reside? In the web object or in the main file? Or, both? 

Steve, I am so grateful for so many of your posts on Java. They save the day...and prevent more gray hair. Lara, thanks for your post. That's what got me started!

Lisa Anderson

After many, amny tests, I've answered my own question.

The trigger to turn the submit variable to true is in the web object SL file. When it is inserted into the main SL file, it does capture the change. Also, in the main SL file, a trigger is placed on the next button to advance, if the variable is true. Works perfectly in both Chrome and IE.

Sometimes all we need is a little inspiration!  Thanks, again!

Joe Boss

Sorry to bump an old thread. This code works beautifully when I publish to CD (for both HTML5 and SWF).  When I publish to web (just a normal FTP), the Captivate SWF files still work fine with the code, the HTML5 never loads (but I'll worry about that separately).


When I publish to a SCORM 2004 package, the code doesn't work at all.  Whether its' published to our LMS, or the SCORM Cloud website, the final interaction doesn't do anything.

Is there something SCORM specific we need to add?


Many thanks for any help you can offer.

Ashley Terwilliger

No apologies necessary Joe - I've seen much older discussions appear! I can't say how those code changes are working in SCORM or in general as Javascript is an area our team can't offer support for - but if you wanted to reach out to individual users in this discussion you could message them using the "contact me" button on their profile! 

Lisa Anderson

Hi Ashely,

Thank your your thoughts about the web object not being able to pass a variable back to SL. Actually, it does work. My variable is in the Web Object and when it's inserted into SL as such, the SL file totally follows it. No extra trigger needed in the SL file. However, there is a java script that does need to be executed for the trigger adjusting the variable.

var player=parent.GetPlayer();

player.SetVar("YourVariableName",true);

It works in all the environments I'm working in; Web Browser, LMS SCORM 1.2 and company intranet.

Lisa Anderson

Hi Joe,

Unfortunately, I'm unsure about SCORM 2004. The java mentioned above in both threads, works for me in SCORM 1.2, web, and SharePoint (company intranet).

I will say in Chrome, it takes a bit of time to load ( a few seconds), but loads just fine and functions. I received additional guidance from http://matthewbibby.com/ for some java assistance. He is extremely helpful and responsive. He's in Australia, so there could be a delay in response, but he'll get back to you.

Wish I could be of more help. I'm grateful I found this old thread and happy it still gets checked into from time to time.

If I think of anything, I'll post it here.

Joe Boss

HI Lisa,

Thanks for your reply and insight. From your reply, you've mentioned you have the javascript in your web object.  Just to confirm, are you using Captivate or some other form of software in conjunction with JavaScript?  If not, I wonder if it's a Captivate specific issue.

In my Slide Master, I've got the variable set up as:

Name: GoNext  Type:  Text

Again on the slide master, I've got a trigger:

Action: Jump to slide, Slide: next slide, When: Variable changes, Variable: goNext.

On my Captivate, I've got a clickable button, with the javascript:

var player=parent.GetPlayer();

var currentTime = new Date();

var uniqueTime=currentTime.getTime();

player.SetVar("goNext",uniqueTime);

Lisa Anderson

Hi Joe,

I'm not as familiar with Captivate, although I do use it on occasion. Both my Web Object and My Master Story were done using SL2.

It sounds like the file you are using as a web object (Captivate?) is the source doing most of the actions. Your Master story (SL, I'm assuming) is watching out for those actions. So, given that, duplicate both (to save them as you have them) and try on the duplicates some tests.

Here's a thought. Create a variable(s) in your Captivate file, something like NameEntered and TextEntered to a value of false. Put those same variables in SL. You have a button in captivate, that when clicked is executing the java you have written above. Have that same button also execute a different java that changes the variables NameEntered and TextEntered to true, when that button is clicked.  Publish as web object. Don't forget to change the .html file Captivate uses to launch a course to index.html. I always do and my web objects don't load.

In SL insert your web object and on that slide, put a trigger, jump to slide, SLIDE XX, when the time line ends, on the conditions that NameEntered and TextEntered are true. All SL is looking for, are those two variables and when it finds them, it will then do it's action.

Can you create your web object in SL, instead of captivate? It might be easier, because they'll speak the same language. It could be that, in this circumstance, Captivate and SL aren't getting along.

Just some thoughts.