| .: Send Message To Host - PART 4 :.
|
Now the last thing is building the javascript code into HTML PAGE. 1) we load the Cult3D.js into the header page, just copy and past this part of code. <HEAD> 2) We detect if the Cult3D .CO project is loaded, just copy and past this part of code. <SCRIPT
LANGUAGE=javascript FOR=CultObject EVENT=OnLoadFinished> < /SCRIPT> <SCRIPT
LANGUAGE=javascript FOR=CultObject EVENT=OnSendMessage> 3) If the Cult3D .CO project is right loaded we get the Send Message TO Host. <SCRIPT
LANGUAGE=javascript> function finishedLoading(refObject)
function receivedMsg() 4) we doing a bit of string split (remember when you split a string each part is stocked into an array and break by a comma) var Chaine = Cult3D.getLastMessage(); document.form.tracker_X.value
= "X : " + resultat[0]; resultat[0] is the X position. and send it to an HTML form to display
the results. For the rest this is only a bit of HTML code to show the Cult3D .CO project and the FORM to display the results. <form name="form" method="post" action="bas.php"> The easy way to use this tutorial is just copy and edit the INDEX.HTML file and replace the Cul3D .CO project name and run it ;) That's is the end of this tutorial, don't hesitate to contact me for more information's or another wanted tutorial ;) |
Go to part 1 - Go to part 2 - Go to part 3 - Go to part 4 - See final result
|