flash与js 互相调用

//function 为此FLASH所在页面的JS函数名
getURL("javascript:function()");

js 传递变量给 flash 最简单的方法是:

//flash为此FLASH的id
flash.setVariable("变量名","变量值");

一般我们看到的可以按按钮跳过FLASH,淡进首页的效果有部分就是通过上面实现的

其实JS还可以直接控制FLASH的播放

2 Responses to flash与js 互相调用 »

  1. HicroKee 评论 2008-08-10 15:02

    Javascript下使用Flash最好的方法是用專用的Flash Lib,跨平台且做interaction比較方便。從FlashMX開始,編譯時可以通過設置,壓縮生成的指令碼,此情況下用Javascript不能讀取出Flash的變量(因爲識別不出變量名,與JS、PHP等腳本的壓縮原理相仿)。至於getURL這個函數,AS3也不用了……這大概是四五年前的方法吧……

    回复

  2. joe 评论 2008-08-10 16:31

    哇~一下子唔知道点理解

    回复

Leave a Reply

Email address is not published

You should say a Chinese word to pass spam check. If you can not input Chinese, just copy 你好 and paste them into comment text box.