Passing JavaScript function in an XML file to Flash

After looking around for an answer I’ve found two ways that sound like they should work, but don’t yet, for me anyway:

Trying to get an HTML link from an XML file to open in a custom browser window. Dynamic HTML enabled text box getting data from the XML file. At some point I think it needs to call a JavaScript function to open the custom window. I have gotten this to work using [CDATA[asfunction:getURL… (in the XML file) but not once I call for the JavaScript. Here’s what I figured out:

I think it can be done using either CDATA in the XML file. Something like this for the XML in your example


<portfolio>
<pictures><![CDATA[<thumb><a href="asfunction:getURL,javascript:openNewWindow('http://www.thelink.com','thewin','height=250,width=300,toolbar=no,scrollbars=yes')">Text to link</a></thumb>]]></pictures>
</portfolio>

or maybe it calls the function in the ActionScript when when you are getting the data for the dynamic text box:

[AS]
output += “<p><a href=“javascript:openNewWin(” + d[c].attributes.thumb + “)” target=”_blank">" + d[c].firstChild.nodeValue + “</a></p>”;
[/AS]

Either one is supposed to call a JavaScript function that is in the head of the HTML file the embedded .swf file is on.

I’m not really sure what I’m missing. Everything else works but I can’t get it to call those functions. Anybody that’s done this successfully? Thanks all!