I build a project with the web player streamed , but the web built can not access the data from the txt files.However ,if I build it with window standalone , it just works well. What is going wrong? what shall I do to solve the problem? Does the WWW class could solve it?
I’m guessing that you are trying to use the System.IO.File read methods which are not available in the web player due to security reasons. Yes, use the WWW class and read the text data from the deployed website.
yes it can. but the txt must be on the web or same domain too.
if its somewhere else you must have a crossdomain configuration file at its place or you can’t access it
And what do you mean by “crossdomain configuration file” ? What is special? How to make the web player access the local txt files without using the website? Is that kind of player just for accessing the data from website?
a webplayer can not access the harddisk anywhere but its own folder and it can only read, you can NOT write data there at all.
check out the manual on the sandbox in the 3.0 webplayer (pretty bottom in the listing of the manual) to read more on the crossdomain stuff.
but even with crossdomain: you can not write to the harddisk of the computer in any way.
assuming I understood you right: flash ↔ unity communication normally goes through JS on the website or tcp connection between the two. I’m not aware of other ways.
but sounds all very strange and I?m sure you are trying to do something 10 times more complicated than needed
I know it can’t, I’m just saying if you’re using the WebPlayer, all you really got is the WWW and its limitations. And if you’re using a standalone game then you would use System.IO.
Look at the example code on the WWW class that tells you how to download something in general.
there you would then put the url to the xml on the web, either as relative path or on a domain with crossdomain.xml configuration setup.
after you ahve done that you use www.text to generate the desired xml object from this string, you can not use any xml functionality that expects a file