We have an application that uses a SitePal talking avatar in our Asp.NET application that we wish to use in a Silverlight application. In Asp.NET, we use the following code to invoke the Avatar:
<div class="rowPanel" style="text-align: left;">
<script language="JavaScript" type="text/javascript" src="https://vhost.oddcast.com/vhost_embed_functions_v2.php?acc=1460967&js=1"></script>
<script language="JavaScript" type="text/javascript">AC_VHost_Embed(1460967, 300, 400, '', 1, 1, 1986041, 0, 1, 0, '4627b06cee4c591411238bee32e628f3', 9);</script>
<script language="javascript" type="text/javascript">
function vh_sceneLoaded() {
sayText(
"The Avatar Speaks.", 4, 1, 2);
sayText(
"The Avatar Speaks Again. ", 4, 1, 2);
}
</script>
</div>
I put the same calls into a Silverlight page using the HTMLPlaceholder control with the following code in my code behind page:
namespace
TestHTMLPlaceholder {
public partial class MainPage : UserControl {
public MainPage() {
InitializeComponent();
phHtml.HtmlSource =
"<div> This is plain text </div> " +
"<div> " +
" <script language=" +
"\"JavaScript\"" +
" type=" +
"\"text/javascript\"" +
" src=" +
"\"https://vhost.oddcast.com/vhost_embed_functions_v2.php?acc=1460967&js=1\">" +
" </script> " +
" <script language=" +
"\"JavaScript\"" +
" type=" +
"\"text/javascript\">" +
"AC_VHost_Embed(1460967, 300, 400, '', 1, 1, 1986041, 0, 1, 0, '4627b06cee4c591411238bee32e628f3', 9);</script> " +
" <script language=" +
"\"javascript\"" +
" type=" +
"\"text/javascript\">" +
" function vh_sceneLoaded() { " +
" sayText(" +
"\"The Avatar Speaks.\"" +
", 4, 1, 2); " +
" sayText(" +
"\"The Avatar Speaks Again. \"" +
", 4, 1, 2); " +
" } " +
" </script> " +
"</div> ";
}
}
}
When I run this, the first <div> (with the plain literal text) displays, so I know I am correctly calling the control, but the second <div> with the javascript calls to invoke the avatar are not displayed.
Is there a limitation on the use of the HTMLPlaceholder control that I don't understand, or do I have a subtle error in the way I've parsed the code to get the explicit double quotes that I missed?
Thanks for your help.
Lee Sauer