0 Replies Latest reply on Mar 10, 2008 11:33 AM by JHight61

    Pass sendAndLoad var to _root

      I have an app that has been getting the username of a user into a simpleConnect for a chat application by passing it in via the embed params, but this creates a security issue and would like to pass it in using sendAndLoad.

      Currently the username value is set simply by using: var username=_root.username, because it's passed in via a php page with that variable in the embed params. Like this:

      <embed src="member.swf?username=<?php echo $row_getMemberData['username']; ?>


      The ID in this example is hardcoded but would be passed in the same way that I'm currently passing in the username:


      member_id = 10762;


      mid = _root.member_id;

      var send:LoadVars = new LoadVars;
      var receive:LoadVars = new LoadVars;

      send.mid = mid;


      receive.onLoad = function(){

      _root.username=this.username;
      }

      send.sendAndLoad(" http://urltomyphppage.php",receive,"POST");

      trace(username);

      stop();


      That trace comes up undefined. I can trace it from within the function, but I need to make it available to the main timeline so the simpleConnect can pick it up....
      As always any help at all would be greatly appreciated!!!

      JAH