<html>
<head>
<script language="javascript" SRC="includeCult3D.js"></script>
<script language="javascript" SRC="Cult3D.js"></script>
<script language="javascript">
<!--
var Cult3D; // Instance of the running Cult3D object
/**
* This function is defined to trigger when the object has been fully loaded.
*
* The function name can be set to anything, just be sure to use the same name when embedding the Cult3D object.
*/
function loadFinished(refObject)
{
// Make sure that only one Cult3D instance are loaded
if (typeof(Cult3D) == "object")
{
return;
}
Cult3D = new Cult3D_Object(refObject); // Create an instance of the Cult3D object
if (Cult3D == null)
{
alert("loadFinished() - Warning Cult3D variable could not be initialized!");
return;
}
}
/**
* This function is defined to be triggered when a Cult3D message is sent.
* You can send define strings to be sent in your Cult3D Designer projects via the action SendMessageToHost
*
* The function name can be set to anything, just be sure to use the same name when embedding the Cult3D object.
*/
function messageSent()
{
if (Cult3D == null)
{
return;
}
var msg = Cult3D.getLastMessage();
alert("Message fetched: \"" + msg + "\"");
}
/**
* This function triggers a Manual Event defined in the Cult3D Designer.
* Doing this you can start actions you defined in the Cult3D Designer.
*/
function triggerCommand(event)
{
if (Cult3D == null)
{
alert("triggerCommand() - Warning Cult3D is not yet fully loaded");
return;
}
Cult3D.triggerEvent(event);
Cult3D.setFocus();
}
// -->
</script>
</head>
<body>
Here you design your page layout as you normally do. Put the below Javascript where you want to position the Cult3D object window in your page.
<script type="text/javascript">
<!--
var myC3DObject = new C3DObject("box.co", "CultObject", "640", "480");
myC3DObject.onLoadFinished("loadFinished"); // This method is defined in this file's head tag
myC3DObject.onSendMessage("messageSent"); // This method is defined in this file's head tag
myC3DObject.addAntialiasing(myC3DObject.AA_FORCED);
myC3DObject.write();
// -->
</script>
<noscript>
<p>Here you can put some error code if a user has disabled Javascript in the browser.</p>
</noscript>
<a href="javascript:void(0)" onClick="triggerCommand('OpenLid');"> Open Lid </a> <br>
<a href="javascript:void(0)" onClick="triggerCommand('CloseLid');"> Close Lid </a> <br>
</body>
</html>
|