【www.hzclsc.cn--热门资讯】
如何在Flash中打开一个定制的浏览器新窗口?
解答: 这个问题,很常见,也讨论过无数次,以前的一些有用的帖子找不到了,现在重新整理如下:
常用也是很简单的方法是用类似
Get URL ( java script:window.open("new.htm"," newwin","width=320,height=320");
这样的一句,但有很多问题,比如打开了新窗口后,原窗口的内容也被替代了。
jimbob写过一个FS Command来解决这个问题。
现在把这种方法详细解说一遍,如果有问题,请大家补充。
1、在Flash中需要执行打开新窗口动作的地方插入以下语句:
FS Command ( open_window , filename.htm;neww in;toolbar=no,location=no,status=no,
menubar=no,scrollbars=no,resizable=no,width=320,height=200 nbsp;
其中Arguments:
filename.htm 要打开的文件名
newwin 新窗口的名字
toolbar=no,location=no,status=no,
menubar=no,scrollbars=no,resizable=no,width=320,height=200 n bsp;新窗口的有关属性,包括尺寸
注意以上三部分要用分号 分隔
2、在File Publish setting...中设定
HTML中的Tempalte : Flash with FSCommand nb sp;
发布
3、编辑发布生成的html文件,找到以下一段:
SCRIPT LANGUAGE= javascript
!--
var InternetExplorer = navigator.appName.inde xOf( Microsoft != -1;
// Handle all the the FSCommand nbs p;messages in a Flash movie
function Movie1_DoFSCommand(command, args) { nbsp;
var Movie1Obj = InternetExplorer ? Movie1 : document.Movie1;
//
// Place your code here...
//
}
...
改为:
SCRIPT LANGUAGE= javascript
!--
var InternetExplorer = navigator.appName.inde xOf( Microsoft != -1;
// Handle all the the FSCommand nbs p;messages in a Flash movie
function Movie1_DoFSCommand(command, args) { nbsp;
var Movie1Obj = InternetExplorer ? Movie1 : document.Movie1;
// Place your code here...
if (command == open_window
{
arg_array=args.split(
window.open(arg_array[0],arg_array[1],arg_array[2]);
}
}
...
OK!
如果是插入现有的html页,可以先发布,再copy相应的代码到html文件
本文来源:http://www.hzclsc.cn/news/44310.html