Showcase and discover digital art at yex

Follow Design Stacks

Subscribe to our free newsletter to get all our latest tutorials and articles delivered directly to your inbox!

Playing the Movie in a Custom Window

Playing the Movie in a Custom Window

Displaying RoboDemo movies in custom windows is really a very nice effect, mainly because such a method sets the movie apart from the Help file and gives it a nice clean “frame.” In addition, this method also has another benefit: It enables you to keep the compiled CHM file at a smaller size, which is a bonus if the SWF file is large; plus, neither the movie nor its host HTML page have to be included in the Baggage Files folder when playing external SWF files. (For an example of how to display a movie that is included in the Baggage Files folder in a custom window, see the following paragraph in this section). However, the price for being able to display an external SWF file is that you must specify an absolute path to the external HTML file in which the SWF file is embedded. If you choose to go this route, you simply must assure yourself that your users will not tinker with the default path assignments in your installer file, or else your Help system will have broken links.

Create a custom window with a JavaScript function that you design and include either in the page code for the topic from which the movie in the custom window will be invoked, or in an external JavaScript file (.js file) to which you would link in your page code and to which you would include in the Baggage Files folder. The following snippet shows an example of such a script, named showSwf():

function showSwf(strUrl) {
var w_left = ((screen.width - 436)/2);
var w_top = ((screen.height - 487)/2);
var w_width = 436;
var w_height = 487;
var strOptions = "location=no";
strOptions += ",toolbar=no";
strOptions += ",menubar=no";
strOptions += ",status=no";
strOptions += ",scrollbars=no";
strOptions += ",resizable=no";
strOptions += ",left=" + w_left;
strOptions += ",top=" + w_top;
strOptions += ",width=" + w_width;
strOptions += ",height=" + w_height;
strOptions += ";";
newWin = window.open(strUrl, "newWin", strOptions);
newWin.document.close();
newWin.focus();
}

For a much simpler window-opening script, Playing the Movie from the TOC. If you do not need the movie to be external to the CHM file, you can, of course, also include the SWF movie in the Baggage Files folder and open it in a custom window. To do that, add the SWF file in question, as well as its host HTML page, to the Baggage Files folder in RoboHelp HTML and then call the same kind of JavaScript window-opening function that you use to display an external SWF file.

Comments