Retrieving variables from Captivate 4 in Flash (AS2)

I've found a couple threads in this forum on this topic, but none of the code suggested in these threads seems to work.  I have a quiz created in Captivate 4.  The 'Results' slide changes a user-defined variable, varCAPChp1Test to 1 on enter of the slide (I use the 'Assign' command from the dropdown in slide properties to assign this variable a value of 1).  I want to reference this variable in my .fla file using AS2.  I load the Captivate swf into an empty movieclip using the following code:
var myMCL = new MovieClipLoader();
myMCL.loadClip("supporting_SWFs/Quizzes/Chp1_Quiz.swf", "mc_EmptySWF"); //the swf loads and functions just fine
checkCompletion = function():Void
    var test = mc_EmptySWF.varCAPChp1Test;
    if(test != null && test == 1)
        trace("Chapter 1 Test completed!");
    else
        trace("?");
addEventListener(Event.ENTER_FRAME, checkCompletion);
//Here is the output when I publish the .fla:
Branching::script:varTotalPts = varTotalPts + 10
rdcmndResume = 1;
deepak branching : scripteval:[object Object];
Branching::script:rdcmndResume = 1;
deepak branching : scripteval:[object Object];
Branching::script:varTotalPts = varTotalPts + 10
rdcmndResume = 1;
deepak branching : scripteval:[object Object];
Branching::script:rdcmndResume = 1;
deepak branching : scripteval:[object Object];
Branching::script:varTotalPts = varTotalPts + 10
rdcmndResume = 1;
deepak branching : scripteval:[object Object];
Branching::script:varUserPts = varUserPts + 10
rdcmndResume = 1;
deepak branching : scripteval:[object Object];
Branching::script:varTotalPts = varTotalPts + 10
rdcmndResume = 1;
deepak branching : scripteval:[object Object];
Branching::script:varUserPts = varUserPts + 10
rdcmndResume = 1;
deepak branching : scripteval:[object Object];
Branching::script:varTotalPts = varTotalPts + 10
rdcmndResume = 1;
deepak branching : scripteval:[object Object];
Branching::script:varCAPChp1Test = 1 //so the value is assigned properly in Captivate, but Flash doesn't "listen" for it.
rdcmndResume = 1;
deepak branching : scripteval:[object Object];

I've changed the code below to just trace the value of a variable in Captivate when it's completely loaded in Flash and I keep getting 'undefined.'  I'm also using a system variable instead of a custom user variable this time.
var myMCL = new MovieClipLoader();
myMCL.loadClip("Chp1_Quiz.swf", "mc_contentHolder");
myMCL.onLoadComplete = function(target_mc:MovieClip)
    var test = mc_contentHolder.rdinfoSlideCount;
    trace(test)
//Here's the output I receive:
undefined
Branching::script:varChp1Test = inprogress
varTotalPts = varTotalPts + 10
rdcmndResume = 1;
deepak branching : scripteval:[object Object];
I know that myMCL.onLoadComplete is working b/c I am receiving the trace output, but Flash is not reading the variable from Captivate.  Can anyone help me see what I'm doing wrong?  I've been doing research on this for several days with no success.  This should be pretty simple and I keep getting 'undefined.'
Thanks.

Similar Messages

  • 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.

  • Passing variables from Captivate to HTML

    Hi All:
    I am trying to figure out how to export system and user variables from Captivate to the html wrapper. What I need to accomplish here is very simple. I want to capture a quizz score and pass that number back to the html file. Can anyone out there help me with this?
    I have been adding the following javascript code to my html file after publishing for testing:
         <script type="text/javascript">
         function SimpleTest()
                alert('I can call javascript');
         function ComplexTest(grade)
                alert('The grade you passed was: ' + grade);
         function ComplexAlternateTest()
                alert('The grade you passed was: ' + GradeVar);
         </script>
    I have successfully tested the first function SimpleTest() so I know that Captivate can communicate with the html file. However, I have not been able to successfully pass any system or user variables to either of the other two test functions. I suspect that I am not getting the syntax correct in the javascript call in Captivate.
    My approach has been to use execute javascript in the on slide exit. I have also tried creating an advanced action that stores a system variable to a user defined variable and then tried sending the user define variable with no success. In the javascript popup window I have been putting ComplexTest(variablename); . I don't know if this is the correct syntax or not??  I have tried using the cpQuizInfoPointsscored system varialbe with and without the $$ signs and I have tried using {score} on the quiz results page. So far no luck. I always get a "variable not defined" error message.
    Sorry for the lengthy message but you would think that something this simple would be more straight forward, but apparently it is not. Thanks in advance for your help.
    Vernon . . .

    Hi Vernon,
    I'm not a JavaScript ninja so I can't answer your question. However take a look at Philips site here http://pipwerks.com/
    He has a lot of interesting stuff in regards to Captivate and JavaScript integration so hopefully you can find the answer on his site.
    /Michael
    Visit my Captivate blog with tips & tricks, tutorials and Widgets.

  • Flash & Coldfusion: retrieving variables from Coldfusion

    I'm interested in receiving variables from Coldfusion without
    reloading my swf.
    (In a way that doesn't make me load out of some random text
    file).
    Does anyone know how to do this?

    use the urlloader class to send data to and receive data from
    cf.

  • Swfs don't work (Captivate and Flash AS2)

    I inserted a .swf from a published Captivate 5 file into my PowerPoint. When I preview the ppt, it plays fine, but when I publish it to Presenter it no longer works. It's just a blank white screen. Any suggestions?
    Additionally, I created a very simple Flash file with basic button functionality and brought it into PowerPoint. It shows up but none of the buttons work, and I have no _global or _root code in it. Any help would be great.

    Unfortunately guys, I wish I had better news, but there's a reason why  Captivate 5 content will not run in Adobe Presenter.
    By default, Cp 5 now publishes using Actionscript 3 and that's the  culprit!
    Presenter is still using Actionscript 2.0 so the problem here is that the  governing codebase in P7 doesn't recognize, and therefore cannot  run/execute/understand the codebase coming from Captivate 5.
    There is, however, a workaround: rather than inserting the Cp swf into PPT  (for Presenter output), you can link to the Captivate content as externally  accessible content.  An obvious drawback here is that you'll have another  browser window to contend with, but there are a few upsides to this approach as  well; namely, if your Captivate content ever needs to be updated, you can do  that without ever having to republish your Presenter course.  I've utilized this  approach a number of times, and although there's some upfront homework to deal  with, it's been a time-saver in the long term.
    Now, as for the Flash file/buttons you mentioned....I have a quick question  for you: are you coding your Flash piece using Actionscript 3?  Again, as weith  Captivate 5, anything with AS 3.0 in it will be completely ignored in Presenter  7.  Also be sure that when you set up a Flash file (and definitely before you  publish/export your flash content) you'll need to set the Publish Settings for  Actionscript 2.0.
    Until Adobe updates Presenter, this is going to be something we all will need  to deal with.
    Rob
    http://www.robrode.com/yabb/

  • 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/

  • Posting variables from Captivate 5

    Dear gurus,
    I would like to be able to post quiz and user variable data from Captivate 5.  I notice that the Cap. 5 has Javascript functionality but is there any way of referencing a lesson's variable data so that it can be posted out of Captivate? 
    My goal is to post data to a server script which will then route the data to a database.  I realise there is the new alternate results feature but I can't use php in my workplace.  I also can't use an LMS for the recording of data.
    Any help would be greatly appreciated.
    Best wishes,
    Mister Gee

    So I keep working with it, trying to get the data from the POST. I've tried using a very rudimentary method of checking to see if I'm able to get the variables, but for some reason, I'm not able to.  Here's a snippet of what I'm doing just to see if I'm getting the values. Once I'm able to write the values to the text file, I'll be able to move forward.
    <%
    dim fs,f
    set fs=Server.CreateObject("Scripting.FileSystemObject")
    dataString = request.form("dataString")
    CompanyName = request.form("CompanyName")
    DepartmentName = request.form("DepartmentName")
    CourseName = request.Form("CourseName")
    Filename = request.Form("Filename")
    Filedata = request.Form("Filedata")
    If NOT fs.FolderExists("D:\Hac_userdata\QWDweb\elearning\CaptivateResults\") then
      fs.CreateFolder("D:\Hac_userdata\QWDweb\elearning\CaptivateResults\")
    Else
    End If
    set f=fs.OpenTextFile("D:\Hac_userdata\QWDweb\elearning\CaptivateResults\test.txt", 8, true)
    f.WriteLine("( " & DepartmentName & " )" & " " & now())
    f.close
    set f=nothing
    Set fs=Nothing
    %>

  • Loading Variables from ASP into Flash

    I can find plenty of tutorials detailing how to load
    variables from a defined asp page into Flash, but here's my
    dilemma...
    I have an asp page that is reading a URL with a unique
    identifier in it (www.sampleURL.com?id=123456), and then turns the
    id number from the URL into a variable. On the same page then, sits
    my swf where I need to use LoadVars to pull in that ASP variable
    via Actionscript. If I don't have a static asp page to pull the
    variables in from and I want to pass the variable within the same
    asp page the swf is located on, how do I do it? Many thanks in
    advance...

    "bonzomn65" <[email protected]> wrote in
    message
    news:ej0630$pjh$[email protected]..
    >I can find plenty of tutorials detailing how to load
    variables from a
    >defined
    > asp page into Flash, but here's my dilemma...
    >
    > I have an asp page that is reading a URL with a unique
    identifier in it
    > (www.sampleURL.com?id=123456), and then turns the id
    number from the URL
    > into a
    > variable. On the same page then, sits my swf where I
    need to use LoadVars
    > to
    > pull in that ASP variable via Actionscript. If I don't
    have a static asp
    > page
    > to pull the variables in from and I want to pass the
    variable within the
    > same
    > asp page the swf is located on, how do I do it? Many
    thanks in advance...
    >
    You don't need LoadVars for this at all. You can just pass
    the variable to
    your Flash movie by specifying a query string when you are
    calling the
    movie.
    If you are using the straight object, embed method then it
    would look
    something like this:
    <param name="movie" value="movie.swf?id=11111">
    <embed src="movie.swf?id=11111" ... >
    If you are using the ActiveContent JavaScript for your movie
    then you just
    leave off the .swf... so
    "name", "movie?id=11111"
    Then, in flash you can access the value of id from the _root,
    like
    var idInFlash:Number = _root.id;
    Of course in the above example you would replace 11111 with
    the proper
    syntax for printing a variable's value in ASP.

  • Passing a variable from text to flash

    How do you pass a variable from a text file to flash?

    Check out Help for loadVariables.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Passing variables from PHP to Flash

    I have a contact form that works. The user enters their info,
    hits submit, and their info is emailed to me. I need to figure out
    how to have the PHP script send back a confirmation that the email
    was actually sent. I can't get the php to echo just a "yes" or
    "no". Here is what I have so far:
    Flash code to bring in PHP variable to notify user if mail
    has been sent or not:
    function receive_response(e:Event):void
    var loader:URLLoader = URLLoader(e.target);
    var email_status = new URLVariables(loader.data).success;
    if(email_status == "yes")
    status_txt.text = "Success! Your message was sent.";
    timer = new Timer(500);
    timer.addEventListener(TimerEvent.TIMER, on_timer);
    timer.start();
    else
    status_txt.text = "Send failed! Please email or call us";
    and here is my entire PHP Code. The code in bold at the bottom
    is where it is supposed to pass the "yes" or "no" as the variable
    success
    <<meta http-equiv="content-type"
    content="text/html;charset=utf-8">
    <?php
    // Create local PHP variables from the info the user gave in
    the Flash form
    $senderName = $_POST['userName'];
    $senderEmail = $_POST['userEmail'];
    $senderMessage = $_POST['userMsg'];
    // Strip slashes on the Local variables
    $senderName = stripslashes($senderName);
    $senderEmail = stripslashes($senderEmail);
    $senderMessage = stripslashes($senderMessage);
    $to = "info@*******.com";
    // change this to reflect your site
    $from = "contact@*********.com";
    $subject = "Contact from ***********.com";
    //Begin HTML Email Message
    $message = <<<EOF
    <html>
    <body bgcolor="#FFFFFF">
    <b>Name</b> = $senderName<br /><br />
    <b>Email</b> = <a
    href="mailto:$senderEmail">$senderEmail</a><br
    /><br />
    <b>Message</b> = $senderMessage<br />
    </body>
    </html>
    EOF;
    //end of message
    $headers = "From: $from\r\n";
    $headers .= "Content-type: text/html\r\n";
    $to = "$to";
    if (mail($to, $subject, $message, $headers))
    echo “success=yes”;
    else
    echo “success=no”;
    exit();
    ?>
    Thanks

    I have a contact form that works. The user enters their info,
    hits submit, and their info is emailed to me. I need to figure out
    how to have the PHP script send back a confirmation that the email
    was actually sent. I can't get the php to echo just a "yes" or
    "no". Here is what I have so far:
    Flash code to bring in PHP variable to notify user if mail
    has been sent or not:
    function receive_response(e:Event):void
    var loader:URLLoader = URLLoader(e.target);
    var email_status = new URLVariables(loader.data).success;
    if(email_status == "yes")
    status_txt.text = "Success! Your message was sent.";
    timer = new Timer(500);
    timer.addEventListener(TimerEvent.TIMER, on_timer);
    timer.start();
    else
    status_txt.text = "Send failed! Please email or call us";
    and here is my entire PHP Code. The code in bold at the bottom
    is where it is supposed to pass the "yes" or "no" as the variable
    success
    <<meta http-equiv="content-type"
    content="text/html;charset=utf-8">
    <?php
    // Create local PHP variables from the info the user gave in
    the Flash form
    $senderName = $_POST['userName'];
    $senderEmail = $_POST['userEmail'];
    $senderMessage = $_POST['userMsg'];
    // Strip slashes on the Local variables
    $senderName = stripslashes($senderName);
    $senderEmail = stripslashes($senderEmail);
    $senderMessage = stripslashes($senderMessage);
    $to = "info@*******.com";
    // change this to reflect your site
    $from = "contact@*********.com";
    $subject = "Contact from ***********.com";
    //Begin HTML Email Message
    $message = <<<EOF
    <html>
    <body bgcolor="#FFFFFF">
    <b>Name</b> = $senderName<br /><br />
    <b>Email</b> = <a
    href="mailto:$senderEmail">$senderEmail</a><br
    /><br />
    <b>Message</b> = $senderMessage<br />
    </body>
    </html>
    EOF;
    //end of message
    $headers = "From: $from\r\n";
    $headers .= "Content-type: text/html\r\n";
    $to = "$to";
    if (mail($to, $subject, $message, $headers))
    echo “success=yes”;
    else
    echo “success=no”;
    exit();
    ?>
    Thanks

  • Passing variables from php to flash and the opposite

    Hi guys, im trying weeks now to solve this problem but nothing yet
    If someone could just tell me how to pass variables from flash to php and the opposite i would be thankful!!! Please help!

    I have recently had to learn this, so this may not be the best way but it worked for me
    I suggest looking at the code below stripping out everything you don't need (e.g. the databse stuff) and just get a simple string going back and forward
    have a go and post any problems here and I'll try and help
    in flash i have
    private function getBalanceAndXP():void
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "getBalance";
              variables.fbid = userID;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.addEventListener(Event.COMPLETE, onBalanceComplete);
              loader.load(request);
    private function onBalanceComplete(e:Event):void
              var loader:URLLoader = e.target as URLLoader;
              loader.removeEventListener(Event.COMPLETE, onBalanceComplete);
              var variables:URLVariables = new URLVariables(loader.data);
              _balance = parseInt(variables.balance); // class variable
              _experience = parseInt(variables.experience); // class variable
    public function setBalanceAndXP(balance:int, experience:int):void
                _balance = balance;
              _experience = experience;
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "setBalance";
              variables.fbid = userID;
              variables.balance = _balance;
              variables.experience = _experience;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.load(request);
    and then I have my php file
    <?php
    $func = $_POST["func"];
    $fbid = $_POST["fbid"];
    $balance = $_POST["balance"];
    $experience = $_POST["experience"];
    $numVariables = 0;
    $link = mysql_connect("localhost","username","password");
    mysql_select_db("databaseName");
    if ($func == "getBalance")
              getBalance($fbid);
    else if ($func == "setBalance")
              setBalance($fbid, $balance, $experience);
    mysql_close($link);
    function getBalance($fbid)
              $query = "SELECT balance, experience FROM tableName WHERE fbid = '".$fbid."'";
              $result = mysql_query($query);
              $row = mysql_fetch_row($result);
              writeVariable("balance", $row[0]);
              writeVariable("experience", $row[1]);
    function setBalance($fbid, $balance, $experience)
              $query = "UPDATE tableName SET balance = ".$balance.", experience = ".$experience." WHERE fbid ='".$fbid."'";
              mysql_query($query);
    function writeVariable( $name, $value )
              global $numVariables;
              if ( $numVariables > 0 )
                        echo "&";
              echo $name . "=" . urlencode($value);
              $numVariables++;
    ?>

  • Load variables from XML into Flash

    I was wondering how to load variables from an XML document to
    a Flash file? I am familiar with the code to do it for a text file,
    but was wondering how to do it for XML.
    Many thanks in advance!
    JJ

    Thanks for the recommendation on the site. What I am trying
    to do is load varaibles from an XML file into text boxes in my
    flash movie.
    Here is my loading:
    var my_xml = new XML();
    my_xml.ignoreWhite = true;
    my_xml.onLoad = function(success){
    if (success) {
    gotoAndStop("slide01");
    my_xml.load("narration.xml");
    this is what I have on my frame with the text boxes (the text
    boxes are also have the variable name in the variable area)
    var narration = my_xml.picture01;
    var my_title = my_xml.my_title;
    var my_date = my_xml.my_date;
    should I do my_date.text = my_xml.my_date; instead?
    my xml doc looks like this
    <?xml version="1.0" encoding="iso-8859-1"?>
    <picture01>This is the text for picture
    01</picture01>
    <picture02>This is the text for picture
    02</picture02>
    <my_title>Las Vegas</my_title>
    <my_date>October</my_date>
    Any help on this would be GREATLY appreciated!
    Text
    my_date.text = my_xml.my_date;

  • Passing dynamic variable from html to Flash

    I know this is pretty simple but all that I have read doesn't make much sense to me. I have one swf calling another swf that I have embedded into an htnl. In other words just calling another html page in a seperate window.
    In one.swf (runing in broswer) I use the below to call another html page passing the variable NewLessonArray. This contains an array of completed chapters.
    // LOADING URL
    var NewLessonCompleteArray:String = LessonCompleteArray.toString();
    navigateToURL(new URLRequest("two/index.html?CurrentLessonInfo=<NewLessonCompleteArray>"), "_blank");
    In the receiving swf I want to retrieve the passing parameters.
    two.swf
    // Getting the parameters passed
    this.loaderInfo.parameters.toString()
    All that is returned that I can see is object Object. But since I am passing on a address line into another swf embedded in a html page I am unable to determine that correct syntac for retrieving the information.
    Any suggestions? This has got to be pretty simple... I think.
    THANKS

    What you are trying to do is not extremely difficult to do, but it is not something I would consider as being simple.  With Andrei's approach you should be able to take the url String and dissect the parameters from it using String methods, like split().
    As for the loaderInfo end of things, you are not passing the parameters to the swf file, you are passing them to the html page.  So the loaderInfo won't have any info for you regarding the url parameters.  The loadInfo would typically get parameters via the FlashVars parameters passed in in the html's swf embedding code.
    Here are some other solutions that you might consider.  I have not dealt with these myself, they are merely in my collection of useful info, so you might have to experiment to get them working.  One is a link to a class-based approach and the other is an approach that use swfObject embedding to dynamically add the parameters as FlashVars to the embedding code....
    http://mikethenderson.com/2009/02/as3-return-query-string-value-version-2/#more-105
    OR
    In your HTML:
    var flashvars = {};
    if (swfobject.getQueryParamValue("aParameter")) {
      flashvars.param = swfobject.getQueryParamValue("aParameter"); 
    swfobject.embedSWF("myMovie.swf", "myContent", "550", "400", "9.0.0", "", flashvars);
    And the param variable will be available as a FlashVar to your movie:
    var theParam = loaderInfo.parameters.param;

  • How do we retrieve notes from Captivate if we have "Notes" interactive in eLearning?

    Hi,
    I came across with this "Notes" interactive in Adobe Captivate 7.  It is a good tool for students to take notes while watching on any eLearning videos.  But, how to allow students to retrieve or save notes that they have taken from the eLearning videos?
    Thanks.

    I think you are talking about the static interaction 'Notes'. Sorry, but an interactive interaction is a bit different in the Captivate terminology (has the possiblity to attach score, which is not the case for the static interactions/widgets).
    Notes will be saved within the Captivate course, but I seem to remember that this is done by using cookies. So clearing the browser cache will delete also the saved notes. It would be a good idea to log a feature request for both another way of saving and for printing. I think already other users did that.
    Lilybiri

Maybe you are looking for

  • Why does iTunes tell me the burner is in use?

    When trying to burn music discs from iTunes, I'm now getting a message that "the burner is already being used by another application." It's really strange because that's not the case and iTunes burned CDs just fine for years until this past week. I g

  • Can I link 2 apple ids

    My son was on a linked apple id now I have created my own how can he retain his downloads from his old account

  • Baseline  date in payment terms

    Hi experts, There're 4 kinds of baseline dates in payment terms: no default, posting date, document date & entry date. I have gone through the relevant thread & tested in the system. However, I found no differences among them, i.e. no matter which ba

  • Who jarred in jdk 1.4

    I upgraded to jdk 1.4 and now as far I understood, it does not create manifest file automatically. Result: it does not load app. I could not find information on it here on first attempt. Does anybody know how to jar in jdk 1.4 and how to write manife

  • I would like to contact Adobe Support and need an email address.

    Unfortunatly I purchased a copy of photoshop Elements from my local Costco, but I have had nothing but trouble with this product. After installing it on my iMac the program will not load and stops and needs to be forced to quite. why is it so difficu