Topic
No replies
SystemAdmin
SystemAdmin
181 Posts
ACCEPTED ANSWER

Pinned topic Widget that calls exernal Javascript

‏2009-10-07T21:14:14Z |
Using the simplified widget model (via .zip) for Mashup Hubs because I can't get a .war version to work. We have a flash file we want to display in a widget, but we want to call an external Javascript file first to confirm that the user has all the prerequisites. This is in my iwidget.xml file:

<iw:iwidget name="helloworld" xmlns:iw="http://www.ibm.com/xmlns/prod/iWidget" supportedModes="view" mode="view" lang="en">
<iw:resource uri="AC_RunActiveContent.js" />
<iw:content mode="view">
<![CDATA[
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '1024',
'height', '768',
'src', 'http://citysrv1.chicago.ibm.com/poc/matrix_chart_mashup/matrix_chart/matrix',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'matrix',
'bgcolor', '#ffffff',
'name', 'matrix',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'matrix',
'FlashVars','dataURI=http://citysrv1.chicago.ibm.com/poc/matrix_chart_mashup/matrix_chart/manyEyesSets/story1/1/1.txt&rootURI=&stateURI=http://citysrv1.chicago.ibm.com/poc/matrix_chart_mashup/matrix_chart/manyEyesSets/story1/1/1.state',

'salign', ''
); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="1024" height="768" id="story1FS" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="http://citysrv1.chicago.ibm.com/poc/matrix_chart_mashup/matrix_chart/matrix.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="http://citysrv1.chicago.ibm.com/poc/matrix_chart_mashup/matrix_chart/matrix.swf" quality="high" bgcolor="#ffffff" width="1024" height="768" name="story1FS" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
]]>
</iw:content>
</iw:iwidget>

This is causing a DOM onload error to occur when I load the widget in Mashups (2.0 beta). Any idea what's causing this?