WWW wrapper in WebPlayer crashing

the docs seem to indicate that web player should be able to upload data to a page that is from the same domain, something like:

      WWW wc = new WWW("http://myUnityGame.com/isInThisFolder/scores.aspx",
        System.Text.Encoding.UTF8.GetBytes(myScoreString));

it works in the standalone and android, but not web player, not even with cross domain file. the crash report says this:

MethodAccessException: Attempt to access a private/protected method failed.
at System.Security.SecurityManager.ThrowException (System.Exception ex) [0x00000] in :0

I also tried with System.Net.WebClient, got the exact same results.

Is there something I’m missing? some configuration? or is this not allowed?

I just build the webgame.unity3d file and ftp it to my web server.

Thanks.

So looks like I figured it out, actually had 2 issues:

First of all the MethodAccessException was something else in the script – Web Player didn’t like Environment.MachineName.

But it still didn’t work.

The second (and more interesting) problem was that the WWW object seems to only work from within a StartCoRoutine call when used in the web player. As soon as I wrapped the WWW call in an IEnumerator function with a yield return, and called it from within a class that was inherited from MonoBehaviour, it started working.

In the standalone and android, WWW worked from anywhere (I was calling it from a standard c# class that was not inherited from MonoBehaviour with no problems). I’m not sure why this would be the case…