Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
  1.  
    Hi! Thanks for the resources you have shared with the dev community. I am working with LegacyCaptivateLoader and have a question. It seems to work fine when I set it up to work with a standalone swf, but I need to run it in a shell-based emplementation.

    i.e.
    if (_standAlone)
    {
    captivate = new LegacyCaptivateLoader("cp_player", "Install_AccessPE.swf");
    }
    else
    {
    theEngine.captivate = new LegacyCaptivateLoader("learningEngine", "res/modules/Install_AccessPE.swf");
    }

    theEngine is the ref to the shell. It runs with no errors but I get no cp swf in shell mode. Anything jump out at you I am doing wrong here?

    Thanks!

    Dave
    davidjmcclelland.com
    • CommentAuthorphilip
    • CommentTimeApr 16th 2008
     
    Hmm... so are you saying the shell version is a SWF loading another SWF which in turn loads the Captivate SWF? Sounds like a scope issue.


    Nesting order of your 'shell' approach
    <html>
    <shell swf (AS3)>
    <cp_player swf (AS3)>
    <captivate swf (AS2)>
    </cp_player swf>
    </shell swf>
    </html>

    Nesting order I used when creating LegacyCaptivateLoader
    <html>
    <cp_player swf (AS3)>
    <captivate swf (AS2)>
    </cp_player swf>
    </html>


    I think nested SWFs should probably work so long as the nested ID is added to the LegacyCaptivateLoader call.

    The two important things to remember here are:

    1. the first parameter of LegacyCaptivateLoader is the ID used by JavaScript to 'grab' the SWF

    2. the first parameter of LegacyCaptivateLoader is also the location of the SWF containing the ExternalInterface callbacks



    var swf = new LegacyCaptivateLoader("main_AS3", "mycaptivatefile.swf");

    In this example, the ExternalInterface callbacks should be located in a SWF with the HTML/JavaScript ID "main_AS3".

    If you try to invoke LegacyCaptivateLoader in a nested SWF, JavaScript won't be able to locate the ExternalInterface callbacks unless you include the ID of the nested SWF in the constructor.

    Assuming you have the following:

    • Primary AS3 SWF ID (the ID used by HTML & JavaScript): "main_AS3"

    • Nested AS3 SWF ID (the ID used by ActionScript): "nestedSWF"



    var swf = new LegacyCaptivateLoader("main_AS3.nestedSWF", "mycaptivatefile.swf");

    In this example, JavaScript grabs the SWF named "main_AS3" then looks for LegacyCaptivateLoader's ExternalInterface callbacks in a child of "main_AS3" named "nestedSWF".

    This is the theory, anyway... I haven't tested it with nested SWFs, and I'm not 100% confident the global ID hack will work with a nested object. If it doesn't, I'm certain the LegacyCaptivateLoader class could be customized to allow a 'nested swf ID' parameter.

    Give it a shot and let me know what happens! :)

    - philip
    • CommentAuthorphilip
    • CommentTimeApr 16th 2008
     
    BTW, i changed the category to "pipwerks LegacyCaptivateLoader"
  2.  
    Hi Philip!

    I managed to get the Captivate content to load in my nested SWF arrangement some time ago. It did not require changing the first argument to refer to the nested swf, but did require some minor tweaks to the LegacyCaptiveLoader. When I have a chance to breathe I will share some things I learned.

    The point of running captivates in a nested swf is a requirement to load a series of these in fairly random sequence. Captivates are interspersed with Flash swfs so I am loading and unloading swfs as the content progresses.

    However, after the first Captivate runs, subsequent ones do not. I hooked up the debugger code to see what is/is not happening and the same events occur in both the first and any subsequent loads. I am testing using the same Captivate swf everywhere.

    I pre-cache each swf in an array before displaying it - only the first Captivate SWF in the Array will display. If I jump to another content section and access the Captivate out of sequence it still doesn't display.

    Any insight on this is much appreciated!

    Dave
    • CommentAuthorphilip
    • CommentTimeMay 16th 2008
     
    Hi Dave

    Have you tried it without caching?
  3.  
    I have browser cache set to 0. Running without the cache enabled in the shell is an interesting idea - I will have to try that.
  4.  
    After 2 other developers looked at what I was trying to do a solution was found to load multiple Captivates. Yay!

    Now I am trying to get the Captivates to run in a SCORM 1.2 environment. I was thinking that they would work seamlessly with your SCORM wrapper, but they don't.

    Do you have a LegacyCaptivate/SCORM 1.2 wrapper combo? Or advice on how to cook one up?

    Thanks!
    • CommentAuthorphilip
    • CommentTimeMay 21st 2008
     
    Cool. What was the solution?

    RE: SCORM, are you trying to use Captivate's built-in SCORM calls with your Flash 'player' SWF? Using Captivate's SCORM code in anything other than a Captivate-generated HTML file is a pain in the butt.

    Captivate's SCORM code uses LocalConnection (and sometimes a proxy SWF) to communicate with the browser, while my SCORM class(es) use ExternalInterface.

    (When Andrew Cherney wrote the SCORM code for Captivate, ExternalInterface hadn't been invented yet, and the Captivate files needed to work in older versions of Flash Player and browsers (IE5, NN, etc.). The best solution was LocalConnection.)

    If you're loading multiple SCORM-enabled Captivate files into a Flash-based player, things get even messier. For instance, each Captivate file is designed to be a single SCO that has its own SCORM APIInitialize and APITerminate calls. Devising a wrapper that can intercept LocalConnection calls and all of those SCORM function calls is a big task, and one I'm not particularly interested in tackling. :wink:

    In my courses, I treat the Captivate files like regular SWFs, and simply monitor whether or not they've been completed (I have an end-of-movie action in the Captivate that invokes a "interactionCompleted()" function in the Flash file). If they've been completed, I have my Flash file handle the SCORM calls; the Captivate has zero SCORM interaction, which means I don't need to rely on the Captivate's SCORM handling at all. Easy livin'.

    BTW, I don't use Captivate's quiz features or report any scores from Captivate. If you're trying to send scores from Captivate to the LMS and/or the Flash file, you've got your work cut out for you! :smile:
  5.  
    When we stop to breathe again I would love to share what we came up with - it will do us good to debrief on it for maintaining going forward too.

    Mainly it required changing the proxy connection script. We replaced the if/else with just the else part (timer polling for proxy.swf readiness) and it started working like a champ. Not sure what we gave up in that change though.

    Sounds like we have a similar approach regarding scoring of Captivates - good. Getting scores out is a big kludge, yes.

    Got everything working together by adding the SCORM src to the legacy Captivate wrapper.