Linking to another story file (javascript?)
Aug 21, 2015
So, here's what I am trying to accomplish: I am using Storyline to simulate a system interaction. To make it as realistic as possible, I created two separate storyline files, one for the content that introduces the system and one for the actual simulation. I set the simulation story to a specific size that mimics how the system (an image viewer) will be displayed. I want the user to click a button from the initial storyline published output to launch the other in a new window (locked at optimal size, no browser controls.)
What I did to try to accomplish this was to publish the simulation story to launch in a new window. Then I opened the launcher window and copied the javascript and created a button in the introductory story to execute a javascript and pasted what I copied from the launcher window. But this is not working. I really don't know anything about javascript, though. Does anyone have any idea about what I might be doing wrong or another way to accomplish this?
4 Replies
Hi Stephen! I'm no JavaScript guru either, but there are many in the community. Hopefully someone will be able to chime in and assist you in your design.
Can you post your Javascript snippet here?
Hi Michael, the js snippet is below. Note that I updated the g_strStartPage variable to show the full URL instead of just the story.html file.
var Safari = (navigator.appVersion.indexOf("Safari") >= 0);
var g_bChromeless = true;
var g_bResizeable = false;
var g_nContentWidth = 807;
var g_nContentHeight = 827;
var g_strStartPage = "story.html";
var g_strBrowserSize = "default";
function LaunchContent()
{
var nWidth = screen.availWidth;
var nHeight = screen.availHeight;
if (nWidth > g_nContentWidth && nHeight > g_nContentHeight && g_strBrowserSize != "fullscreen")
{
nWidth = g_nContentWidth;
nHeight = g_nContentHeight;
if (!Safari && !g_bChromeless)
{
nWidth += 17;
}
}
// Build the options string
var strOptions = "width=" + nWidth +",height=" + nHeight;
if (g_bResizeable)
{
strOptions += ",resizable=yes"
}
else
{
strOptions += ",resizable=no"
}
if (g_bChromeless)
{
strOptions += ", status=0, toolbar=0, location=0, menubar=0, scrollbars=0";
}
else
{
strOptions += ", status=1, toolbar=1, location=1, menubar=1, scrollbars=1";
}
// Launch the URL
if (Safari)
{
var oWnd = window.open("", "_blank", strOptions);
oWnd.location = g_strStartPage;
}
else
{
window.open(g_strStartPage , "_blank", strOptions);
}
}
Thanks Stephen for sharing that code here and hopefully someone in the community whose a Javascript pro will be able to check it out.
This discussion is closed. You can start a new discussion or contact Articulate Support.