开发者

Calling a javascript function from a flash from xml config file

I've got a flash file that reads some links from an xml config file. These links look like:

<url target="_blank" method="GET"><![CDATA[http://www.google.com]]></url>

Instead of a link, I'd like to call a javascript method that opens up a modal dialog with a list of items. I've tried the following based on some things I found, but I can't get it to work.

<url target="_self" method="GET"><![CDATA[javascript:loadAsModal(#modaldiv, ajaxmenu.jsp?gid=3)]]></url>

and

<url target="_self" method="GET"><script type="text/javascript"><![CDATA[loadAsModal(#modaldiv, ajaxmenu.jsp?gid开发者_运维百科=3)]]></script></url>

Any ideas? loadAsModal() takes in an empty div that i put on the page, and then the menu.jsp which builds the menu given the group id. I made sure to import all of my js libraries on the page.


i have no clue how the above is supposed to work. remember that flash is all about actionscript, not javascript.

instead you could use ExternalInterface in flash to call your javascript function. just pull the url from your xml (as in the first snippet your provided) and try something like this:

ExternalInterface.call('loadAsModal', '#modaldiv', 'ajaxmenu.jsp?gid=3');

you might want to replace 'ajaxmenu.jsp' with the url you loaded though, as i suppose.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜