Passing Captivate variables to Flash widget

Hello,
I'm developing a simple progress bar widget in Flash to add to a Captivate course I'm building.  I believe what I want to do is very simple, but I appear to be missing something.
Quick synopsis:
I have created a variable in Captivate 5.5 called intProgress which should be a percentage of a student's progress through the course. I set this manually via an Advanced Action upon entering the slide.
I've also created a Progress Bar widget in Flash 5.5.  It consists of nothing more than a manual progress bar component in Flash.
I want to feed that intProgress value from Captivate into my Flash widget, and have the progress bar update accordingly.
Here is my function (aPb is my progress bar) -
function courseProgress(intPercentage)
          aPb.setProgress(intPercentage, 100)
And here is how I am trying to pass the variable over:
courseProgress(MovieClip(root).intProgress);
It doesn't look like the variable is coming across from Captivate to the widget.  How can I correctly do this?
Please let me know what I'm doing wrong and/or what I'm missing here.
Thanks for any help anyone can provide!
Daniel

Cool - I've found out how to access my custom variable thanks to your help.  Right now, I'm using a simple text field as a debug (instead of the progress bar) just until I get everything sorted out.
In the cpSetValue function of the widget, I tested with the slide name variable you provided first:
myText.text = "label:" + m_VariableHandle.cpInfoCurrentSlideLabel;
And then progressed onward to my custom variable.
myText.text = "prog:" + m_VariableHandle.intProgress; (my custom variable)
So I have full connection to those, they're reading perfectly.  That m_VariableHandle is giving me the connection I need (good to know for the future).
They're just not getting updated.  It just keep showing the values for the first slide - for both the SlideLabel and the custom variable. So now my trouble lies not in the reading of the variable, but the updating of it - to get the most current value.  That's a step forward though, very happy about that.
To answer your question - yes, I'm doing a variable modification on every slide enter.  I'll set my intProgress variable to 5, then maybe 10 on the next slide, then 15, etc.  It's very important that I set that manually, as my project is not linear.  In other words, there may be a trail of 10 slides later on that are a "side" branch - and not part of the course progression.
So, thanks again for your help. I'm a whole lot closer than I was before!

Similar Messages

  • LoadVars-using send to pass a variable from flash to php

    For the life of me, I've tried everything:
    I've researched LoadVars on Adobe forum, used David Powers'
    books, googled 'flash to php', LoadVars, etc. and tried
    sendAndLoad, send, and using $_POST, $_GET, $_REQUEST.
    $HTTP_POSTVARS but I keep getting this same error. any advice
    please?
    I have a Unix server running Apache/PHP 4 - LoadVars worked
    to load name-value pairs into an array -see thread)
    My goal with this simple app is to prototype being able to
    pass a variable from flash to a variable in php.
    Parse error: syntax error, unexpected T_VARIABLE in
    flash_to_SQL.php on line 5
    Actionscript 2.0 code:
    var c :LoadVars = new LoadVars();
    c.testing = "123FOUR";
    c.send ("
    http://127.0.0.1/flash_to_SQL.php","_self","POST");
    php code: (I also tried $_POST, $_GET, $_REQUEST.
    $HTTP_POSTVARS)
    <?php
    //mysql 4.1.2, php 4 , NO mysqli
    ecbo $_REQUEST ['testing'];
    /?>

    var formData:LoadVars = new LoadVars();
    formData.fname = "Name";
    formData.send("
    http://www.website.com/flash_php.php",
    formData, "POST");
    <?php
    $name = $_POST['fname'];
    echo $name;
    ?>

  • Is there any way at all of accessing captivate variables from flash?

    Hi,
    I would be grateful for any help on this one.  I have been working in flash and I wanted to know whether there is any way at all of calling/accessing captivate 4 variables from flash (I'm working in flash Cs4 Actionscript 3.0 and I'm trialling Captivate 4, but I just want to know whether there is any way/method of communicating between a flash file and a captivate 4 file, and if so, can this be done with an embedded captivate 4 file/swf).  Surely there must be a way of communicating between the two - they are both Adobe products!
    Thanks for any help, pointers, advice, tips in advance.

    Hi Louon,
    Don't know if this would help you.
    http://blogs.adobe.com/captivate/2009/09/captivate_variables_-_how_to_a.html
    We have many experts here who could give more precise answers.
    Cheers.
    Miguel

  • Passing Captivate Variables to Embedded swf

    Hello,
    How can i read a captivate variable in embedded swf file like cpInfoCurrentSlide;
    Thanks

    var cpRoot:Object = MovieClip(root);
    var mainmov:Object = MovieClip(cpRoot.parent.root);
    mainmov.cpInfoCurrentSlide
    mainmov.rdinfoCurrentSlide
    Some things only work with the old rd variables.
    This works for 6 and 7, I haven't tested on 8 yet.

  • Passing a variable from Flash Cs3 (AS2) to C#

    I am working on what I thought would be a simple microsoft windows form application.  In the application I load a .swf file, straight and simple, but when the last frame is reached I need to pass information to the C# program that the last page has been reached - I thought a variable [finished = 1] or a string [end="Finished"] would work best.
    I have google,d binged, and searched through these forums but I cannot find anything that I can understand.  As you can tell I am a very casual flash and C# user (=noob), any help would be greatly appreciated.
    Thank you in advance for any assistance
    Woodtd

    Thank you for your response.
    Do you have a code snippet or other example that shows how to do this?
    Thanks
    Tim

  • Can Captivate pass variables to Flash?

    I have a Captivate 4 quiz embedded in a .FLA (AS2).  Can this quiz pass user-defined and/or system variables to the .FLA?  If so, can someone give me an example code of how this would work?  Let's say I have a user-defined variable in Captivate, varTest with initial value of 0.  On the last slide of the quiz I assign varTest a value of 1.  How do I pass this variable to Flash and how will Flash listen for this value change?  I'm looking for something similar to the following code, but I can't seem to get all of it:
    //code that loads movie here; I have this piece working fine.
    //code that listens for varTest1 value in Captivate
    myListener = function():Void
         var myFlashVar = this.mc_Container.varTest //I load my captivate SWF into mc_Container
         if(myFlashVar == 1)
              trace("myFlash Var = 1")
    some listener code here...
    Thanks.

    samprakash,
    You are going into difficult territory.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=464&threadid=1325387
    There is no solution other than a custom solution, likely
    involving many days and hours of work. If you must do this, you can
    begin by analyzing the swf files for variables while in-use (loop
    through the Captivate swf mc object).

  • Controling Captivate Slide elements from flash widget

    I am creating a widget in Flash and I am able to control the captivate movie by widget. But I do not know how to control the elements (clickbox, highlightbox or images) appearing on slide.
    Is it possible to show/hide and image appearing in captivate slide from flash widget.

    I have the same issue.
    I have a button "Button_1" that I am trying to turn invisible, and have tried:
    var myRoot:MovieClip = MovieClip(root);
    var mainmov:MovieClip = MovieClip(myRoot.parent.root);
    mainmov.slide0__color_mc.Button_1.visible = false;
    Also tried:
    mainmov.Button_1.visible = false;
    Neither works.

  • Sending multiple variable to flash

    I did the following in passing several multiple to flash
    PHP code
    <?php
         $d  = array();
         $p = array();
         $t = array();
         require_once('C:\xampp\htdocs\moodle\config.php');
        $data = $DB->get_records_sql('SELECT questiontext,id FROM {question}');
        foreach ($data  as $element)  {
        $d[] = $element->questiontext ;
        $p[] = $element->id;}
        echo "var1=".urlencode($d[1])."&var2=".urlencode($p[1]);
    ?>
    Actionscript code
    var myLoader:URLLoader = new URLLoader();
    myLoader.dataFormat = URLLoaderDataFormat.TEXT;
    var myRequest:URLRequest=new URLRequest("http://localhost/moodle/selectquestion.php");
    myLoader.load(myRequest);
    myLoader.addEventListener(Event.COMPLETE,onCompleteHandler);
    var myValue: String;
    var valuetwo: String;
    function onCompleteHandler(e:Event):void{
       myValue = e.target.data.var1;
                          valuetwo = e.target.data.var2;
       trace(myValue);
       trace(valuetwo);
    However, error shows in actionscript that
    ReferenceError: Error #1069: Property var1 not found on String and there is no default value.
    Is there anything wrong in my php code or in the actionscript? How should I pass multiple variable to flash?

    I can fix it now as I should add
    var myvariable: URLVariables = new URLVariables(e.target.data);      
    to my actionscript code and then
    myValue = myvariable.var1;
    valuetwo = myvariable.var2;
    trace(myValue);
    trace(valuetwo);
    I can then trace back.

  • Variables into flash movie  -  Urgent help needed, please

    I am hoping this is simple:
    Here is my HTML code:
    <param name="movie" value="orig2.swf" /><param
    name=FlashVars VALUE="sname=video1.flv"><param name="quality"
    value="high" /><param name="bgcolor" value="#ffffff" />
    I need to pass video1.flv to the flash movie.
    Here is the MOVIE data. I was told this is how to do it, but
    I am sure it's missing something basic.
    //insert sample link below
    mediaDisplay.directLink = "
    http://flash.xxx.com/flashgen.cgi?sname=&aname=xxxxxxxx/_definst_";
    //pulls sname from param value in HTML
    mediaDisplay.simplePlaylist = sname;
    streamnameTxt.text = sname;
    So, it should pull the SNAME variable from HTML and feed it
    into player. If I type in SNAME variable and manually place it in
    DirectLink line above, it works, but I need it to feed from HTML.
    PLEASE HELP!!

    I know how to pass the variable TO flash, but how do I get
    the FLASH movie to receive it??
    Again, here is the code in the FLA file
    //insert sample link below
    mediaDisplay.directLink = "
    http://flash.xxx.com/flashgen.cgi?sname=&aname=xxxxxxxx/_definst_";
    //pulls sname from param value in HTML
    mediaDisplay.simplePlaylist = sname;
    streamnameTxt.text = sname;

  • Passing a variable from Captivate 5 to Flash CS5/ActionScript 3

    I don't get it. Why is it so difficult to pass a variable from Captivate 5 to AS3/Flash CS5. I must be making it harder than it really is. I cannot figure it out.  Can anyone help?
    I have a variable (gpDone = 1) defined in Captivate 5 (it's a guided practice) on the last frame which will indicate that the learner has completed the guided practice file.
    Now I want to pass that variable back to Flash/AS3 so I can evaluate whether I should show the Continue button so they can continue. They have to complete the guided practice before they can continue. If it is equal to 1, the Continue button will display. If it is not equal to 1, the Continue button will not display, but a message will display telling them they have to complete the guided practice in order to continue in the course.
    Do I need to edit the Flash html? Or just put code in the Flash timeline or the associated AS file?
    Help would be greatly appreciated. Thanks in advance.
    CAH

    Having the same problem...getting variable values FROM captivate to my inserted .swf (not widgets).
    I can set the value from the .swf to the captivate using Object(parent.parent.parent.parent).captivateVariable but not the other way around.
    Very frustrating.
    I hope someone answers your query.

  • Tracing Captivate 4 variables in Flash CS4 using AS3

    Hello. I've googled this 9 ways to Sunday and can't find an answer. I'm hoping one of you can help.
    I have a very simple Captivate 4 quiz with one question. I embed the Captivate SWF file in a Flash file, which plays fine. However I am struggling with tracing one of the Captivate variables in the Flash file using AS3.
    All I want is for Flash to read the Captivate variables so I can continue developing my quiz in Flash (building additional functionality Captivate does not provide).
    The variable I'm attempting to trace is cpInfoAuthor.
    I've attempted:
    trace(root.cpInfoAuthor);
    trace(root.movie.cpInfoAuthor);
    var cpAuthor = MovieClip(root).cpInfoAuthor;
    All of the above examples error out: TypeError: Error #1009: Cannot access a property or method of a null object reference.
    Captivate preferences are set to publish in AS3.
    Anyone with an explanation?
    Be splendid, Jodie.

    Hi Jodie,
    I'm not exactly 100% proficient in AS3 but to me it looks like your statements are wrong.
    Since you are loading your Captivate SWF into a Flash SWF then (root) actually refers to your Flash SWF. I guess that you are loading your Captivate SWF into a movieclip on your Flash stage and that movieclip has an instance name,
    You would therefore need to grab the variables like var cpAuthor = yourLoaderMovieClip.cpInfoAuthor;
    See if that doesn't do the trick for you.
    /Michael
    Visit my Captivate blog with tips & tricks, tutorials and Widgets.

  • AS3.0 External Interface: Pass variables to flash using javascript

    Hello all,
    I am looking for a simple and straightfoward example of how I can pass the value of a variable into flash using javascript.
    Specifically, I'd like to use javascript to pass the filename of an external video file that I would like to load into my flash movie.
    I'd also like to call a function in the SWF that plays the movie once the filename as been passed to the flash movie.
    External Inferface looks like the way to go.
    I've found a few decent AS2.0 examples, but converting them to AS3.0 has proven difficult and many of the examples are much too complex for what I am trying to do.
    If you have any code samples or tutorials showing the HTML/Javascript and the associated actionscript I'd really appreciate it!
    Thanks!
    Tim

    if you create a swf (eiTest.swf) and html:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
        <head>
            <title>eiTest</title>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <script language="JavaScript">
             function thisMovie(movieName) {
             if (navigator.appName.indexOf("Microsoft") != -1) {
                 return window[movieName];
             } else {
                 return document[movieName];
         function f1(value) {
             thisMovie("eiTest").jsF(value);
    </script>
        </head>
             <body onload="f1('yourfilename.ext');">
         <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                 id="eiTest" width="550" height="400"
                 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
             <param name="movie" value="eiTest.swf" />
             <param name="quality" value="high" />
             <param name="bgcolor" value="#869ca7" />
             <param name="allowScriptAccess" value="sameDomain" />
             <embed src="eiTest.swf" quality="high" bgcolor="#869ca7"
                 width="550" height="400" name="eiTest" align="middle"
                 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
                 type="application/x-shockwave-flash"
                 pluginspage="http://www.macromedia.com/go/getflashplayer">
             </embed>
         </object>
        </body>
    </html>
    you can use:
    import flash.external.ExternalInterface;
    ExternalInterface.addCallback("jsF", asF);
    function asF(fileS:String):void{
    trace(fileS);

  • How to pass a variable from HTML to Flash

    I have built my flash ad banner in Flash 9 and now want the
    HTML code to pass the url over to the flash movie that it should
    jump to when clicked.
    The info in the help file seems out of date for the latest
    HTML template as it uses mainly JavaScript to get round IE's
    dreadful embeding issue. So my problem is, how do I pass a variable
    from the HTML to the actionScript specified int he Help file
    (running on a full screen button) as shown below?
    myButton_btn.onRelease = function() {
    if (clickTAG.substr(0, 5) == "http:") {
    getURL(clickTAG);
    via the html code now used by Flash 9 which is like this:
    <!-- saved from url=(0013)about:internet -->
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Advert_long</title>
    <script language="javascript"> AC_FL_RunContent = 0;
    </script>
    <script language="javascript"> DetectFlashVer = 0;
    </script>
    <script src="AC_RunActiveContent.js"
    language="javascript"></script>
    <script language="JavaScript" type="text/javascript">
    <!--
    // Globals
    // Major version of Flash required
    var requiredMajorVersion = 9;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Revision of Flash required
    var requiredRevision = 115;
    // -->
    </script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    Coping
    with
    Growing
    Audio
    Series
    Theraputic stories
    for children aged
    4 to 9
    -->
    <script language="JavaScript" type="text/javascript">
    <!--
    if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {
    var hasRightVersion = DetectFlashVer(requiredMajorVersion,
    requiredMinorVersion, requiredRevision);
    if(hasRightVersion) { // if we've detected an acceptable
    version
    // embed the flash movie
    AC_FL_RunContent(
    'codebase', '
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
    'width', '120',
    'height', '600',
    'src', 'Advert_long',
    'quality', 'high',
    'pluginspage', '
    http://www.macromedia.com/go/getflashplayer',
    'align', 'middle',
    'play', 'true',
    'loop', 'true',
    'scale', 'showall',
    'wmode', 'window',
    'devicefont', 'false',
    'id', 'Advert_long',
    'bgcolor', '#ffffff',
    'name', 'Advert_long',
    'menu', 'true',
    'allowScriptAccess','sameDomain',
    'allowFullScreen','false',
    'movie', 'Advert_long',
    'salign', ''
    ); //end AC code
    } else { // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be
    placed here.'
    + 'This content requires the Adobe Flash Player.'
    + '<a href=http://www.macromedia.com/go/getflash/>Get
    Flash</a>';
    document.write(alternateContent); // insert non-flash content
    // -->
    </script>
    <noscript>
    // Provide alternate content for browsers that do not support
    scripting
    // or for those that have scripting disabled.
    Alternate HTML content should be placed here. This content
    requires the Adobe Flash Player.
    <a href="
    http://www.macromedia.com/go/getflash/">Get
    Flash</a>
    </noscript>
    </body>
    </html>

    You should use SWFObject to embed your Flash. Not only does
    it make
    embedding more straightforward, it makes passing query
    parameters very easy.
    Check out:
    http://code.google.com/p/swfobject/
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How to pass a variable from HTML to Flash 9

    I have built my flash ad banner in Flash 9 and now want the
    HTML code to pass the url over to the flash movie that it should
    jump to when clicked.
    The info in the help file seems out of date for the latest
    HTML template as it uses mainly JavaScript to get round IE's
    dreadful embeding issue. So my problem is, how do I pass a variable
    from the HTML to the actionScript specified int he Help file
    (running on a full screen button) as shown below?
    myButton_btn.onRelease = function() {
    if (clickTAG.substr(0, 5) == "http:") {
    getURL(clickTAG);
    via the html code now used by Flash 9 which is like this:
    <!-- saved from url=(0013)about:internet -->
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Advert_long</title>
    <script language="javascript"> AC_FL_RunContent = 0;
    </script>
    <script language="javascript"> DetectFlashVer = 0;
    </script>
    <script src="AC_RunActiveContent.js"
    language="javascript"></script>
    <script language="JavaScript" type="text/javascript">
    <!--
    // Globals
    // Major version of Flash required
    var requiredMajorVersion = 9;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Revision of Flash required
    var requiredRevision = 115;
    // -->
    </script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    Coping
    with
    Growing
    Audio
    Series
    Theraputic stories
    for children aged
    4 to 9
    -->
    <script language="JavaScript" type="text/javascript">
    <!--
    if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {
    var hasRightVersion = DetectFlashVer(requiredMajorVersion,
    requiredMinorVersion, requiredRevision);
    if(hasRightVersion) { // if we've detected an acceptable
    version
    // embed the flash movie
    AC_FL_RunContent(
    'codebase', '
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
    'width', '120',
    'height', '600',
    'src', 'Advert_long',
    'quality', 'high',
    'pluginspage', '
    http://www.macromedia.com/go/getflashplayer',
    'align', 'middle',
    'play', 'true',
    'loop', 'true',
    'scale', 'showall',
    'wmode', 'window',
    'devicefont', 'false',
    'id', 'Advert_long',
    'bgcolor', '#ffffff',
    'name', 'Advert_long',
    'menu', 'true',
    'allowScriptAccess','sameDomain',
    'allowFullScreen','false',
    'movie', 'Advert_long',
    'salign', ''
    ); //end AC code
    } else { // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be
    placed here.'
    + 'This content requires the Adobe Flash Player.'
    + '<a href=http://www.macromedia.com/go/getflash/>Get
    Flash</a>';
    document.write(alternateContent); // insert non-flash
    content
    // -->
    </script>
    <noscript>
    // Provide alternate content for browsers that do not
    support scripting
    // or for those that have scripting disabled.
    Alternate HTML content should be placed here. This content
    requires the Adobe Flash Player.
    <a href="
    http://www.macromedia.com/go/getflash/">Get
    Flash</a>
    </noscript>
    </body>
    </html>

    You should use SWFObject to embed your Flash. Not only does
    it make
    embedding more straightforward, it makes passing query
    parameters very easy.
    Check out:
    http://code.google.com/p/swfobject/
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How to integrate adobe flash widgets from Adobe captivate with Adobe Presenter?

    Hi all,
    We are a group of students who are creating a number of flash widgets that allows them to create e-learning  activities. We are creating specific widgets in Flash  for use in Captivate and then the results of the widgets in Adobe Presenter. The  client noticed that widgets that work in Adobe Captivate don't always work in  Adobe Presenter. Is there a way to make this function  correctly?
    Secondly, if it  isn't possible to make that work correctly through the first method, is it  possible to utilise Adobe Air to do the same or similar process. The client  would prefer if we could integrate anything we use with an LMS and SCORM. But we  believe it may not be possible to do this with Adobe Air.
    Would someone be able to help us out with this?
    Thanx

    Some of the functionalities of CP4 (I assume that you use this version?) only work in a CP-published SWF, p.e. using the right mouse click as a trigger. I have inserted several CP-SWF's into Adobe Presenter, while using some of the widgets provided with CP4 and did not have any problems with these (p.e. Flash button). But I do not know what kind of widgets you created. Do they function all right in CP4 itself?
    Lilybiri

Maybe you are looking for