在ActionScript中调用JavaScript函数 [英] Call JavaScript function within ActionScript

查看:84
本文介绍了在ActionScript中调用JavaScript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不熟悉ActionScript,由于某种原因,以下代码无法使用,尽管在本教程中是这样提到的:

I'm not familiar with ActionScript and for some reason the following code won't work, although it was mentioned that way in a tutorial:

class Dummy {

  function Dummy() {
  }

  static function main(mc) {

    getURL("javascript:alert('works!')");
  }

}

我使用 mtasc进行编译

I used "mtasc" to compile the script.

推荐答案

当您将Flash文件嵌入页面时,您是否设置allowscriptaccess = true

when you're embedding the flash file in your page are you setting allowscriptaccess="true"

如此:

<embed src="flash.swf" allowscriptaccess="true"></embed>

这篇关于在ActionScript中调用JavaScript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆