Skip to content
Nerothos edited this page Nov 13, 2015 · 1 revision
    <h2><a name="faq">Frequently Asked Questions</a></h2>

    <div class="question">
        <p>How can I open Shadowbox from inside a Flash movie?</p>
        <p>Use ActionScript's <a href="http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary377.html">getURL</a> function to call some Shadowbox code. There are several ways you can do this. The easiest is to define a JavaScript callback function similar to the one below.</p>
<script type="text/javascript">
function openShadowbox(content, player, title){
    Shadowbox.open({
        content:    content,
        player:     player,
        title:      title
    });
}
</script>
        <p>You can place this function in between <code>&lt;head&gt;</code> tags in your HTML document, or include it via <code>&lt;script&gt;</code> tags. Then, in your Flash movie you need to use <code>getURL</code> to call your custom callback function, like so:</p>
getURL("javascript:openShadowbox('movie.swf', 'swf', 'Title')");
    </div>

    <div class="question">
        <p>How can I open Shadowbox from inside an iframe?</p>
        <p>The basic concept here is that you have two windows: the normal window and the iframe. When an iframe is placed inside another window, that window becomes the parent window of that iframe. In order to run JavaScript in the parent window from inside an iframe, you must figure out how to make calls to objects that reside in the parent window.</p>
        <p>Luckily for us, each window (including iframe windows) contains an object called <code>parent</code> that refers to the parent of that window. Thus, you can use the following code inside your iframe document to access the <code>Shadowbox</code> object that resides in the parent window:</p>
var Shadowbox = window.parent.Shadowbox;
// do whatever you want with Shadowbox here
        <p>Once you have access to the <code>Shadowbox</code> object, you can use it as you normally would. Just remember that since the Shadowbox object still resides in the parent window, all actions will take place in the parent window. To use Shadowbox inside an iframe, you must of course include the Shadowbox code as usual at the top of the document inside the iframe.</p>
    </div>

    <div class="question">
        <p>How do I use the JW FLV player to play Flash video?</p>
        <p>The <a href="http://www.longtailvideo.com/players/jw-flv-player/">JW FLV player</a> is not included in the Shadowbox distribution according to the terms of the <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/">Creative Commons BY-NC-SA 2.0</a> license. In order to use it with Shadowbox, you should download the player <a href="http://www.longtailvideo.com/players/jw-flv-player/">from the longtail website</a> and unzip the mediaplayer.zip file to your <code>libraries</code> directory. This should create a directory named <code>mediaplayer</code> with the <code>player.swf</code> file inside it. After you do this, the Shadowbox FLV player should be able to find it and use it.</p>
        <p>If you have problems getting it to work, try checking the permissions on the directory and the file. The <code>mediaplayer</code> directory, just like all directories that you'd like to be publicly viewable, must be readable.</p>
        <p>If you'd like to customize the FlashVars that you pass to the JW FLV player, you can find a full list of available FlashVars <a href="http://developer.longtailvideo.com/trac/wiki/FlashVars">here</a>.
    </p></div>

    <div class="question">
        <p>If I purchase a Shadowbox license, is that good for the JW FLV player as well?</p>
        <p>No. If you would like to use the JW FLV player in a corporate setting, please <a href="http://www.longtailvideo.com/players/order">purchase a separate license</a> from the longtail website.</p>
    </div>

    <div class="question">
        <p>Why do I have errors in Internet Explorer when it works in other web browsers?</p>
        <p>Are you using the proper <a href="Support">DOCTYPE</a>?</p>
    </div>

    <div class="question">
        <p>How do I include a caption?</p>
        <p>Shadowbox does not currently support captions.</p>
    </div>

    <div class="question">
        <p>Can I display PDF files using Shadowbox?</p>
        <p>There is currently no 100% reliable method of determining via JavaScript whether or not a user's browser is capable of displaying a PDF or if PDF's must be downloaded and viewed in Acrobat. For this reason, Shadowbox does not include PDF support.</p>
    </div>

</div>

Clone this wiki locally