Silverlight onload param - point to a namespaced function
===

I have to embed a Silverlight control in a page. My JavaScript is namespaced (e.g. functions are created as properties of global "namespace" objects). I need to set the "onload" parameter of the Silverlight control to be one such namespaced function. Everything I've tried to get this to work has not succeeded.

Example:

    <object id="SilverlightControl" data="data:application/x-silverlight-2," type="application/x-silverlight-2">
      <param name="source" value="XapFilePath">
      <param name="onload" value="MyNameSpace.doSomething()">
      <param name="minRuntimeVersion" value="5.0.61118.0">
      <param name="autoUpgrade" value="true">
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=5.0.61118.0" style="text-decoration: none">
        <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style: none">
      </a>
    </object>

    <script type="text/javascript">
       var MyNameSpace = {};
       MyNameSpace.doSomething = function() {
           alert('I'm doing something.');
       };
    </script>

Is there a way to get this to work?

Thanks for any help.