Control Captivate Within Captivate

Caesar

 

 

 

I received an email from a fellow Captivate Developer asking if it was possible to have a Main Cp swf control another “demo” swf inserted as an animation.  Specifically she wanted the “demo” swf to send a message to the Main swf to move on to the next slide.  YES… THIS IS POSSIBLE!!!  pizza pizza!

How?  Through JavaScript awesomeness (of course!).  Where’s the BEEF?!?!

Simply place a button on the demo slide and set it to execute this JavaScript:

function nextSlide(){
var objCP = document.Captivate;
objCP.cpEISetValue(‘rdcmndNextSlide’, 1);
}

nextSlide();

OR you can have this done automatically by placing the JS code on a slide entry or exit action.  It’s up to you.

Try the

*** Live Demo ***

Why does this work?  document.Captivate resolves to the MAIN swf so you can control it using rdcmndNextSlide.or any movie control variable.  You could even pass user variables to the Mains swf this way.  That should get your wheels turnin’

Download Source

pizza pizza!

Tags:

  • http://twitter.com/CaptivatePro CaptivateDev.com

    Control an #AdobeCaptivate swf within a Captivate swf using JavaScript: http://goo.gl/ulV0b  PIZZA PIZZA!!!  #eLearning

  • http://gainpips.com/forex-contest Forex Contest

    My partner and I absolutely love your blog and find a lot of your post’s to be precisely what I’m looking for. Can you offer guest writers to write content available for you? I wouldn’t mind writing a post or elaborating on many of the subjects you write about here. Again, awesome website!

  • JRA

    Speaking of an SWF talking to another… if this is too off subject-my apologies.  Could a Quiz developed in Captivate be inserted into Presenter and that score be shared for LMS recording purposes?

    • http://twitter.com/CaptivatePro CaptivateDev.com

      @JRA:  Out of the box… no.  With a developed widget, possibly.

  • Rod Ward

    Thanks to people like you it gets harder and harder to say that Captivate can’t do something!  Where will it all end?

  • http://www.facebook.com/catherine.tarbox Catherine Tarbox

    Thank you for the post.  Learning something new every day usng Captivate.  Love your site and work.

  • Patrick Smith

    Jim, I’ve noticed a “bug” when you insert a cp swf into another cp project.  When you create the demo swf from cp with no playbar and insert it into a cp main project that has the playbar enabled, when you get to the slide with the inserted demo swf, the playbar in the main will disappear.  Have you seen this? and is there a work around?

    • http://twitter.com/CaptivatePro CaptivateDev.com

      @d5e5813ab7c0baf6389a30f3dd4a783c:disqus :  I’d show the playbar in the demo, but set the alpha to 1 or zero, remove all the playbar buttons, then remove the skin borders.  This will prevent the playbar from disappearing in the mains swf once the demo swf has been viewed AND make it look like there really is no playbar in the demo.  Kinda hacky, but it works.