webpage with a webplayer

Hello,

i have unity project with only prefeb of a Cube, build as webplayer streaming.

i would like to put this webplayer in a web page using visual studio 2010, asp.net.

so i open a new asp.net project, open a new webform. i copy the code from the webplayer(the page unity built) to my webform.

now when i run this page it contains the webplayer.

i wanna add a button and a textbox, when the user click on the btn the textbox changes its text.

input type=“text” name = “text1” value=“hoello” id=“123”/>

input type=“button” name=“button10”

value=“yaron” onclick=Anyoutput() />

script type=“text/javascript” language=“javascript”>

function SaySomethingToUnity() {

document.getElementById(“123”).value = “pls let it change me”;
}
script>

but when i put this on the page with a webplayer, nothing happens for some reason, as if javascript events are disabled. any ideas on whats the problem?

Best Regards

Ron

You don’t need an asp.net page to accomplish what you’re trying to do, an .html page is enough if you’re not gonna do something server side. Anyway your problem is that you’re using

onclick=Anyoutput()

but your javasript function is named

SaySomethingToUnity()

Change either of them and it’ll probably work, if there isn’t any syntax mistake.

not sure if this is Unity3D related or more a Visual Studio problem?

If you make a new Webform within VS2010, you get a FORM element in the HTML. Drag a button and a textfield onto your page and let VS2010 do the coding for that.

Then doubleclick the button in the editor and this will open up the script/event part behind the button.

Now you are ready to code C# in ASP.net


But is your problem that you want to build a HTML item that communicates with the Unity3D player or are you trying to build some kinda login to your Unity project?