Alas, I’ve read hundreds of posts on LoadVars.SendAndLoad and cannot fix my problem. I have two circumstances in which I’m confused. In one case I’m counting the number of users in chat, sending the variable to a php, which then writes the value into a mysql database. In the second, I’m loading a chat with some predefined personal variables grabbed from another MySQL database.
In both cases the variables send and load perfectly fine while I’m running them from the FlashMX testing environment. Once I deploy the SWF into my apache folder or anywhere else, the LoadVars.onLoad always returns false. I change no code at all. I’ve attempted every variation of the sendandload and am wondering if anyone else has the same problem(ie. GET, POST, getReceive;…). My development box is running flashcom, php, apache, mysql). For the sake of this post, I’ll give some source.
stop();
userName = _root.username;
guestName = _root.guestname;
guest_name = guestName;
doConnect();
//
function doConnect() {
im_nc = new NetConnection();
im_nc.connect(“rtmp://192.168.2.11/chatIM”, userName);
im_nc.onStatus = function(info) {
trace(info.code);
if (info.code == “NetConnection.Connect.Success”) {
findVars();
light.connect(im_nc);
chat.connect(im_nc);
}
};
}
//
function findVars() {
sendlv = new LoadVars();
sendlv.membername = guestName;
sendlv.sendAndLoad(“http://www.swingular.com/PhpGetVars.php”, sendlv, “GET”);
sendlv.onLoad = function(success) {
if (success) {
gender = this.gender;
location = this.location;
trace("Gender: “+gender+” Location: "+location);
location_label = location;
gender_label = gender;
}
};
}
//