swfkit中打开其他文件的方法

本文介绍了使用SWFKit Pro 3.2版本在SWF文件中打开外部多媒体文件的方法,包括利用QuickTime Player播放.mov视频的具体实现步骤,并提供了一个有效的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我这里为swfkit pro3.2版本~

前阵子因为工作需要,需要在swf中打开外部的word,ppt,mov等文件,所以就用上了打包工具swfkit。

查看了swfkit帮助

Playing avi, rm, mov, wmv, etc movies

By embedding the popular movie players in the main window, SWFKit can play almost all popular movie types. Just like reusing the web browser, embedding a movie player requires that you first use the "createControl" method to create the movie player, then call the methods and properties of the movie player to play movies. All methods, properties, and events of the ActiveX controls can be accessed in FFish script.

因为我主要是QuickTime的视频,所以要用到一下的方法

To embed the QuickTime Player

var ax = createControl("QuickTime.QuickTime", 0, 0, 200, 200);ax.activex.setUrl("c:\\my.mov");ax.activex.play();

The reference of the QuickTime can be found at here

If you want to use these ActiveX controls directly in action script in Flash 8, you would have to wrap them in action script classes.

但是测试了好多次都不成功~

后来用了SWFKIT另外一个方法,可以解决问题

import SWFKit.*;//导入类包,自己要在flash软件里去设置
var AppPath:String;
AppPath = Global.getAppDir();//这个打包成功后,会得到应用程序的当前绝对路径
var myShell:Shell = new Shell();//这个你可以查看swfkit的帮助,就是打开文件时,我们理解的双击作用(个人理解);

my_btn.addEventListener(MouseEvent.CLICK,onclick);

function onclick(e:MouseEvent):void {
      var openPath:String = root.AppPath +"指定目录//"+"指定文件名";//如果root.AppPath 的路径不是你自己需要的路径,你自己要去改动
root.myShell.open(openPath);
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值