惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - trace

flash8与javascript集成 ASP.NET 2.0母版页(MasterPage) “核弹”击中晚期直肠癌 驳图王:轻轻一招,获取上万IP SEO技巧一 很实用的缓动函数 [原创]flash动态改变注册点解决方案 flash+webservice 乱码问题解决一例(原创) 为flash构建asp.net Webservice flash 与 webservice 通信的两种方式 Flash 与 Web Service 技术的完美结 FLASH与WebService Flash 与 Web Service 技术的完美结合 Flash常用代码的介绍 flash 与 后台语言通讯 flash与js通讯(2) flash to js 使用工具包 用Javascript实现鼠标拖拽网页表单 (二) 用Javascript实现鼠标拖拽网页表单(一)
flash to js
trace · 2007-07-16 · via 博客园 - trace

在Flash里面怎么调用Javascript函数--弹出一个js的对话框

首先我们要了解flash是怎样通过fscommand于js进行通讯的.我们应该知道,flash可以通过
getURL()函数执行你想执行的js连接页面(就是弹出自己定义的ie页面).但是用fscomman执
行js可以实现更多的效果,下面就是通过fscommand调用js函数弹出一个对话框的例子.
该例子执行过程是:当fscommand函数执行,IE用一小段VB script程序捕捉FScommand并且提
交到Javascript,那么js函数将会执行.
例子演示下面分四步完成此例子:
1.首先建立一个flash文件,文件名是alert.fla,并在此flash建立FSCommand函数.
在此flash里面的一个按钮写如下的代码:
on(press){
fscommand("flash_alert","wellcomm to www.100000why.net" target="_blank" target="_blank">2.建立一个html文件,并插入刚刚做的flash文件alert,在此最重要一步就是为你的 flash对象命名,因为必须对你的flash命名,因为ie捕捉你的FSCommand函数是依赖你对象名.例子id是testmovie,以下是html里面包含插入alert文件的代码:
<HTML>
<HEAD>
<TITLE>仙龙掌--alert</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF"> <table width="75" border="0" align="center">
<tr>
<td>
<OBJECT
CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
WIDTH="200"
HEIGHT="120"
CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flashlash.cab";;
ID=testmovie>
<PARAM NAME="MOVIE" VALUE="alert">
</OBJECT></td>
</tr>
</table>
</BODY>
</HTML> 3.为IE加VB script
因为上一步已经对象已经命名为testmovie,那么在VS里面要注明是为的 FSCommand捕捉服务的,并且呼叫js函数.
<script LANGUAGE="VBscript">
Sub testmovie_FSCommand(ByVal command, ByVal args)
call testmovie_DoFSCommand(command, args)
end sub
</script>
上面这段代码实现的功能就是捕捉flash的FSCommand并发给js,执行js函数. 4.加入js函数
此部分就是实现弹出对话框的功能.因对象名是:testmovie.所以在js函数里面有必须的这么,如下就是:testmovie_DoFSCommand做了注明,否则无法执行了.如下就是该例子的代码.
<script LANGUAGE="Javascript">
function testmovie_DoFSCommand(command, args) {
if (command == "flash_alert") {
alert("message from flash: " + args);
}
}
</script>
上面的4步,就实现了flash弹出对话框的功能了.通过这个例子就可以清楚的知道,flash是
如何实现与js进行通讯的.我们可以举一反三通过这样实现更多的更玄的功能.可以通过ie
页面控制flash的播放等.