How To Execute Files from Flash如何执行文件从Flash
This weekend I spent much time on creating a Flash projector for a menu based installation of Office and other programs. 本周末,我花了很多时间创造一个闪光投影机的菜单基于Office的安装和其他程序。 The screenshot below explains better what I was trying to accomplish, when someone clicks on the button named Engelsk (Engelsk = English) I wanted setup.exe to launch with a transform file applied to it. 下面的截图中更好地解释什么,我尝试完成的,当有人按下按钮,命名为英文网页(英文网页=英语)我想Setup.exe以启动与转换文件适用于它。
I spent a lot of time playing around with the FSCommand EXEC, but it would not work. 我花了很多时间,玩弄与fscommand Exec的,但它是行不通的。 This was how you did it in previous versions of Flash. 这是你如何做,这在以前版本的Flash 。 So after some trying and failing I started to google the problem and it turned out that the 因此,经过一些尝试和失败我开始到Google的问题和原来这是该 FSCommand EXEC is no longer working as it used to in Flash CS3 fscommand Exec的不再是工作,因为它用来在Flash cs3 . 。
So I needed to find another solution, I then came over a great tool called Proxy from Northcode that solved all my problems and the best thing: It’s free 因此,我需要找到另一种解决办法,我后来是一个伟大的工具,所谓的代理从northcode认为,解决我所有的问题和最好的事情: itâ € ™的免费
Here is a summary from Nothcode’s blog about why this tool was developed and how it works; 这里是一个简要从nothcodeâ € ™的博客,为什么这个工具是发达国家和如何运作;
A typical requirement you’ll run across when developing CD based Flash projects is the need to open documents from your Flash projector. 一个典型的要求,您会遇到发展的CD时,基于闪存的项目是需要公开的文件从您的Flash投影机。 You can use getURL to open most documents, but sometimes the document opens behind the projector. 您可以使用geturl打开大多数文件,但有时文件打开背后的投影机。 The EXEC fscommand could be used to launch a helper application, but unfortunately the EXEC fscommand doesn’t allow you to pass parameters to external applications so you have no way to tell the outside world which file you want to open. 该Exec的fscommand可以用来发射小帮手的应用,但可惜Exec的fscommand不允许您将参数传递到外部应用程序,使你有没有办法告诉外部世界,这要打开的文件。
You can thank the creators of the first Flash virus ( 您可以感谢的创作者第一闪光病毒( SWF/LFM-926 swf/lfm-926 ) for the fact that every version of the stand-alone Flash player since Flash MX has restricted the use of the EXEC command. )事实上,每一个版本的立场,独立的Flash Player以来, Flash MX中限制使用该Exec的命令。 This change made it impossible for anyone to create any new Flash based viruses, but it also crippled the Flash projector as a tool for legitimate users by instantly rendering many free projector extension tools useless. 这一变化使得任何人都不可能创造任何新的Flash为基础的病毒,但它也削弱闪光投影机作为一种工具,合法用户即时提供许多免费的延长投影机的工具无用的。
There are four key restrictions that you have to keep in mind when working with the EXEC fscommand and standalone Flash projectors. 有四个关键的限制,你必须紧记,当工作与Exec的fscommand和独立闪存投影机。 (i) Executables you want to run via the EXEC fscommand have to be in a special sandboxed folder called fscommand in the same directory as the projector. (一)可执行文件,你要运行的经Exec的fscommand都必须在一个特殊的文件夹sandboxed所谓fscommand在同一目录投影机。 (ii) You can’t specify a path in the EXEC command, just a filename. ( ii )您不能指定路径,在Exec的指挥,只是一个文件名。 If the specified file is not found in the fscommand folder, it won’t run. 如果指定的文件是没有发现,在fscommand文件夹,它不会运行。 (iii) The only argument allowed by the EXEC fscommand is a filename, there is no way to pass arguments to the executables that you want to run. (三)唯一论据,允许由Exec的fscommand是一个文件名,是没有办法通过的论据,以可执行文件与您要运行的。 (iv) You can’t use EXEC from an SWF file, it will only work from a projector (EXE). (四)您不能使用Exec的从SWF文件,它只会工作,从一台投影数据( EXE ) 。 The last restriction doesn’t really concern us, but if you’re trying to test your EXEC calls, being aware of it will save you some frustration. 在过去的限制,并不真正关心我们,但如果您尝试测试您的Exec的来电中,意识到它会为您节省一些挫折感。
One additional restriction you will have to deal with is the fact that 一额外的限制,你将要面对的事实是, Flash 9 projectors can’t launch BAT files on Windows 2000, XP and Vista 闪存九投影机无法启动,蝙蝠的文件Windows 2000 , XP和Vista的 . 。
One solution to get around the limitations of the EXEC fscommand is to create one exectuable file for each file that you want to open, but what can you do if you don’t know how to make EXE files? 解决办法之一,以避免限制的Exec的fscommand就是要创造一个exectuable文件为每个文件您要开放,但可以做什么如果您不知道如何使exe文件呢? Windows and Flash both consider a BAT file as an executable file so the easy solution is to create a BAT file for each file you want to open and EXEC the BAT file from Flash. Windows和闪存都考虑一个bat文件作为一个可执行文件,所以很容易的解决办法是建立一个bat文件为每个要打开的文件和Exec的蝙蝠从Flash文件。 You don’t need to be a BAT file wizard to do this, the simple one-liner below (let’s call it mydoc.bat) will do the trick: 您不需要一个bat文件向导来做到这一点,简单的一班轮下面(让我们称之为mydoc.bat )也将这样做的伎俩:
That example assumes that both mydoc.bat and mydoc.pdf are in the fscommand folder. 这个例子假设双方mydoc.bat和mydoc.pdf是,在fscommand文件夹中。 You can change the BAT file to launch the PDF file from anywhere you like, as long as you can create a valid path to the file. 你可以改变bat文件,推出PDF档案从任何地方你喜欢,只要你可以创建一个有效的文件的路径。 Now all you have to do is create a BAT file for every file you want to open and call it from Flash like this: 现在,所有你必须做的是创造一个bat文件,为每一个要打开的文件,并要求它从Flash是这样的:
The only problem with this approach is that your user is going to see the ugly black DOS box appear every time they open a file. 唯一的问题,这种做法是您的用户将会看到丑陋的黑色DOS的框出现每一次他们打开一个文件。 That’s where the proxy utility can help you create a more professional looking end product for your users. Proxy is able to launch BAT files and suppress the ugly DOS box. 这也就是代理实用工具可以帮助您创建一个更加专业的作品最终产品为您的用户 。 代理是能够发射蝙蝠档案和制止丑恶DOS的方块。
usage: proxy.exe 用法: proxy.exe
When you run the proxy utility, the first thing it does is look at its own name, in this case proxy.exe. 当您运行代理公用事业,第一件事,但这是看其个人的名义,在这种情况下proxy.exe 。 It then looks for a BAT file in the same directory with the same base name, ie proxy.bat, and runs that BAT file. 然后期待一个bat文件在同一目录与同一基地的名称,即proxy.bat ,并运行说, bat文件。 If you rename the proxy utility to xyz.exe then the utility will look for and try to run xyz.bat. 如果您重新命名代理实用工具xyz.exe然后公用事业将寻找和尝试运行xyz.bat 。 If a BAT file with the same name can’t be found, proxy will just fail silently. 如果一个bat文件具有相同名称无法找到,代理将不只是默默。
By making copies of proxy.exe with different names and creating multiple BAT files you can run as many “hidden” BAT files as you need, neatly sidestepping the Flash limitation on passing parameters to external applications. 由决策的副本proxy.exe与不同的名称和创建多个蝙蝠档案您可以运行许多“隐性”蝙蝠档案,作为满足你的需要,整齐地回避闪光的限制参数传递到外部应用。
Here are step by step instructions to use the proxy utility to open a PDF file without the ugly DOS box. 这里是一步一步的指示,使用代理实用工具来打开PDF文件,没有丑陋的DOS的方块。
- Create a BAT file called file1.bat that contains just the following line. 创建一个bat文件所谓file1.bat只包含下列行。 This is a plain text file that you can create with notepad or your favorite text editor. 这是一个纯文本文件,您可以创建与记事本或您最喜爱的文本编辑器。
- Put the BAT file in a folder called fscommand along with a copy of proxy.exe. 把bat文件在一个文件夹中所谓的fscommand随着副本proxy.exe 。
- Rename the copy of proxy.exe to file1.exe (same base name as the BAT file you created). 重新命名的副本proxy.exe ,以file1.exe (同一基地的名称作为bat文件您创建的) 。
- Place your PDF document (called file1.pdf) in the fscommand folder with the BAT and EXE files. 把您的PDF文件(所谓的file1.pdf ) ,在fscommand文件夹,蝙蝠和exe文件。 You don’t have to store the files you want to open in the fscommand folder, but for your first test this makes things easier. 您不必为了存储文件要打开,在fscommand文件夹,但对于您的第一次测试这使得事情更加容易。
- Add the following command to your FLA where you want to open the PDF document (probably on a button release action). 添加下列命令到您的FLA您想要打开PDF文件(可能是对一个按钮,释放行动) 。
Now put your Flash EXE and the fscommand folder on your desktop and run the Flash EXE. 现在向各位提出您的Flash的EXE和fscommand文件夹在您的桌面上运行的Flash exe文件。 When the EXEC command is called your PDF document should open. 当Exec的命令是所谓您的PDF文件应该开放。
To read more about proxy or to download it you can go 若要了解更多关于Proxy或下载它,你可以去 here 这里 . 。
Written by Odd-Magne Kristoffersen. 写的奇数magne •克里斯多夫森。 Read more great feeds at is source 阅读更多伟大的饲料是来源 WEBSITE 网站
1 comment 1条评论 . 。
Read more articles on 阅读更多的文章 software 软件 . 。
- [+] Digg [ + ] digg : Feature this article :特征此文章
- [+] Del.icio.us [ + ] del.icio.us : Bookmark this article :书签此文章
- [+] Furl [ + ] furl : Bookmark this article :书签此文章





















#1 # 1 . 。 February 8th, 2008, at 2:43 PM. 2008年2月8日,在下午2点43分。
Is it possible to open a flash projector *exe within a *.swf?是否有可能打开一个闪光*投影机的EXE一个*.瑞士法郎? I need the flash projector to open an external app using facommand *.exe and *.bat.我需要的Flash投影机打开一个外部应用程序使用facommand *.的EXE和*.蝙蝠。