html里怎样用JavaScript调用silverlight里的方法?该怎么处理

html里怎样用JavaScript调用silverlight里的方法?
如题,求详细代码?急!

------解决方案--------------------
HTML code
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<!-- saved from url=(0014)about:internet -->
<head>
  <title>Silverlight Project Test Page </title>

  <style type="text/css">
  html, body {
  }
  body {
  padding: 0;
  margin: 0;
  }
  #silverlightControlHost {  
  }
      .highlightedParagraph
    {
    color: White;
    background-color: Lime;     
    }
  </style>
   
 
  <script type="text/javascript">
    function onSilverlightError(sender, args) {
      if (args.errorType == "InitializeError")  {
        var errorDiv = document.getElementById("errorLocation");
        if (errorDiv != null)
          errorDiv.innerHTML = args.errorType + "- " + args.errorMessage;
      }
    }
  </script>
 
  <script type="text/javascript">
  /////调用Silverlight中函数
  function changeText()
  {
    var control = document.getElementById("silverlightControl");
    control.content.Page.ChangeText("This TextBlock has been updated through JavaScript.");
  }
  /////调用Silverlight中函数
  function getRandom1To6()
  {
    var control = document.getElementById("silverlightControl");
    var random = control.content.services.createObject("RandomNumbers");
    alert("Your number is: " + random.GetRandomNumberInRange(1, 6));
  }
  </script>
</head>

<body>
  <!-- Runtime errors from Silverlight will be displayed here.
This will contain debugging information and should be removed or hidden when debugging is completed -->
<div id='errorLocation' style="font-size: small;color: Gray;"> </div>

  <div id="silverlightControlHost">
<object data="data:application/x-silverlight," type="application/x-silverlight-2" width="400" height="300" id="silverlightControl">
<param name="source" value="ScriptableSilverlight.xap"/>
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />

<a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;">
  <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
</a>
</object>
<iframe style='visibility:hidden;height:0;width:0;border:0px'> </iframe>
  </div>
  /////调用Silverlight中函数
  <p onclick="changeText()">Click here to change the Silverlight TextBlock. </p> 
  <p onclick="getRandom1To6()">Click here to get a random number from 1 to 6. </p>