简体   繁体   English

调用外部JavaScript函数

[英]Call External JavaScript Function

I have an ActionScript program that I want to access some external JavaScript functions. 我有一个ActionScript程序,我想访问一些外部JavaScript函数。 By external, I mean that the ActionScript/swf aren't going to be loaded via the HTML/JavaScript. 在外部,我的意思是ActionScript / swf不会通过HTML / JavaScript加载。 Everything I see recommends ExternalInterface , but that seems to imply that your JS loads your swf. 我看到的所有内容都建议使用ExternalInterface ,但这似乎意味着您的JS加载了swf。 Is there a way to call a JavaScript function by URL? 有没有办法通过URL调用JavaScript函数?

I'm not sure what do you mean by calling a JavaScript function by URL, what you probably need is a JSON based web interface / service. 我不确定通过URL调用JavaScript函数是什么意思,您可能需要的是基于JSON的Web界面/服务。

How / where do you plan to run the Flash content if not embedded in the HTML? 如果未嵌入HTML,您打算如何/在何处运行Flash内容? You'll need one place or an other to actually run that JS code, be it on client side in the browser or server side (in which case you need the webservice). 您实际上需要一个地方或另一个地方来运行该JS代码,无论是在浏览器的客户端端还是服务器端(在这种情况下,您都需要Web服务)。

So your page will contain some JavaScript to execute, but your Flash app will not be running in a browser? 因此,您的页面将包含一些要执行的JavaScript,但是您的Flash应用程序将无法在浏览器中运行吗? Can't you just use navigateToURL to open an HTML page containing JavaScript that executes on page load? 您不能只使用navigateToURL打开包含在页面加载时执行的JavaScript的HTML页面吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM