我这里为swfkit pro3.2版本~
前阵子因为工作需要,需要在swf中打开外部的word,ppt,mov等文件,所以就用上了打包工具swfkit。
查看了swfkit帮助
Playing avi, rm, mov, wmv, etc moviesBy 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);
}