1 Reply Latest reply on Apr 18, 2006 4:02 AM by blemmo

    Problem passing variable from PHP to Flash

    jd7474 Level 1
      I'm trying to pass a single variable from PHP to Flash. However, I can't quite get it to work.

      In a PHP file named data.php, I'm using:
      $query = SELECT SUM(Debt) As Total FROM debtclock";
      $result = mysql_query($query);
      $debt = mysql_result($result, "Total");
      print "debttotal=$debt";

      In Flash 8 Actionscript, I'm using:
      loadVariables("data.php","0");

      As I understand it, this should make the variable debttotal available in Flash.

      Can anyone tell me where I'm going wrong?
        • 1. Re: Problem passing variable from PHP to Flash
          blemmo Level 1
          Try this:
          loadVariables("data.php", _level0);
          The 2nd parameter specifies the target MC that receives the variables, "0" isn't a valid value for that. With _level0, the variables will end up in the root timeline, so you can access them with _root.debttotal (from _level0) or _level0.debttotal (from another level than _level0).

          greets,
          blemmo