- Home /
WebPlayer and WWW, stalls forever on get....
Hello.
I have a bit of code. I'm new to unity, so I'm not sure where i'm going wrong. The last line of code is never run because it keeps getting stuck on the WWW get request (yeild). Am I doing something wrong with executing this in the web player?
Thanks, stringa
function Start() {
anotherFunction();
ExternalEval("alert('End of Start')");
}
function anotherFunction() {
// Wait until cookies are loaded while(!CookieCutter.loaded) yield WaitForSeconds(5.1);
var cookieValue : String;
// Read testCookie cookieValue=CookieCutter.GetCookie("fbs_appid");
var hashTable = new Hashtable();
// SetDefault if(!String.IsNullOrEmpty(cookieValue)) { cookieValue = cookieValue.Trim("\""[0]);
ExternalEval("alert('trimmed : " + cookieValue + "')");
var nameValues = cookieValue.Split("&"[0]);
for(var element in nameValues)
{
var splitElement = element.Split(["="[0]], 2);
hashTable[splitElement[0]] = splitElement[1];
}
ExternalEval("alert('access Token : " + hashTable["access_token"] + "')");
// --- Now lets do a web call
accessToken();
} else { // Else modify value cookieValue = "! Cookie";
accessToken();
}
// Display the cookie value guiText.text=cookieValue;
// And save it in the browser //CookieCutter.SetCookie("testCookie",cookieValue,100);
}
function accessToken() {
ExternalEval("alert('starting to grab fb info')");
var url = "https://www.google.com";
//var url = "https://graph.facebook.com/me/likes?access_token=" + hashTable["access_token"];
var www: WWW = new WWW(url);
ExternalEval("alert('wait for web get')");
yield www;
ExternalEval("alert(' : " + www.data + "')");
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613071504im_/https://answers.unity.com/themes/thub/images/avi.jpg)