function pluginInit(hash) { //This fxn is always executed when the plug-in is instantiated } function pluginRequest(hash) { //When you request something of the plug-in from Flash it goes through this fxn. url = hash.get("Url"); respondTo = hash.get("username"); sendAndLoad_test(); load_test(); } function load_test() { //Equivalent to using the load() method on the LoadVars object in ActionScript. //This loads data from a remote URL as name value pairs (results are loaded into this object) //When finished, the callback function that you assigned is called myLoadVars = new LoadVars(); myLoadVars.onLoad = load_callback; myLoadVars.load(url+"?data=Wazzup"); } function load_callback(success, error) { trace("____________") trace("Finished executing the 'load_test()' fxn."); if (success) { trace("It was a success!") for (var i in this) { if (i != "onLoad" && i!="sendAndLoad" && i!="Method" && i!="owner" && i!="load" && i!="refName") { //The above != strings are methods/properties on the object that aren't hidden trace(i+"="+this[i]); } } } else { trace("It failed to load"); trace(error) } var ob = new Object(); ob.success = success; if (success) { ob.EntireString = this.EntireString; } else { ob.error = error; } var users = new Array(); users.push(respondTo); server.sendMessage("private", users, "load_callback", ob); } function sendAndLoad_test() { //Equivalent to sendAndLoad method on the LoadVars object in ActionScript. //This loads data from a remote URL as name value pairs into the destination LoadVars object that you specify //When finished, the callback function that you assigned is called myLoadVars = new LoadVars(); myLoadVars.data = "yo"; destination = new LoadVars(); destination.onLoad = sendAndLoad_callback; myLoadVars.sendAndLoad(url, destination); } function sendAndLoad_callback(success, error) { trace("____________") trace("Finished executing the 'sendAndLoad_test()' fxn."); if (success) { trace("It was a success!") for (var i in this) { if (i != "onLoad" && i!="sendAndLoad" && i!="Method" && i!="owner" && i!="load" && i!="refName") { //The above != strings are methods/properties on the object that aren't hidden trace(i+"="+this[i]); } } } else { trace("It failed to load"); trace(error) } var ob = new Object(); ob.success = success; if (success) { ob.EntireString = this.EntireString; } else { ob.error = error; } var users = new Array(); users.push(respondTo); server.sendMessage("private", users, "sendAndLoad_callback", ob); }