将 Flash 站点合并为一个可执行文件
我需要以某种方式将 flash 站点合并到一个可执行文件中。
网站包括: 索引.html 图片 声音 pdf文件 等等。
点击合并文件后,需要打开index.html。
这可能吗?
=======================================
Adobe AIR 可能对此有用,但我只能创建安装可执行文件,也许可以只创建可执行文件?
I need somehow to merge flash site into one executable.
Site consists of:
index.html
images
sounds
pdfs
etc.
After clicking on a merged file, index.html is needed to be opened.
Is this possible?
=====================================
Adobe AIR might be useful for this, but I can only create setup executable, maybe it is possible to create just executable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将任意数量的文件打包到 AIR 应用程序中(尽管导出时间可能会大幅增加)。您无法创建“仅”可执行文件,因为需要安装 AIR 应用程序,并且 HTMLLoader 无论如何都需要单独的页面和图片文件。基本上,您需要做的就是:
对于 pdf 文件要在浏览器中工作,用户需要安装 Acrobat。 Flash 内容应在 mx:HTML 内运行。
更新:
对用户隐藏所有文件更加困难。我做了类似的事情,不是整个网站,而是带有嵌入页面和链接的应用程序。
您的所有内容都可以打包到某个 zip 文件中(不是在 exe 中,即使是本机 AIR 应用程序也无法自定义其 exe 包装器。)如果您愿意,您甚至可以加密每个文件。问题是链接和文件(图片、样式和脚本)。
我使用数据 URI 方案解决了图片问题(请参阅我的问题 - 自我回答 - 关于此问题。 )我认为其他文件也可以通过这种方式嵌入。
要使链接正常工作,您需要监听 Event.LOCATION_CHANGE。新位置将告诉 HTML 控件想要去哪里(它将无法找到页面),解压缩相应的页面并将其设置为 htmlText。
因此,如果您确实希望嵌入所有内容,那么我会这样做:
You can pack any number of files into AIR app (although export time may rise substantially). You can't create 'just' executable, because AIR apps need to be installed and HTMLLoader will need separate files for pages and pictures anyway. Basically, all you need to do is:
For pdf files to work in the browser, user need Acrobat installed. Flash content should work inside mx:HTML.
Update:
Hide all files from user is harder. I did something similar though, not entire site, but application with embedded pages and links.
All your content can be packed into some zip file (not in exe, even native AIR application cannot customize its exe wrapper.) You can even encrypt each file if you wish. The problem is links and files (pictures, styles and scripts.)
I solved pictures problem with data URI scheme (see my question - self-answered - about this.) I think other files can be embedded this way too.
To make links working, you need to listen to Event.LOCATION_CHANGE. New location will tell where HTML control wants to go (it will not be able to find page), unzip corresponding page and set it as htmlText.
So, if you really wish to embed everything, that's what I would do:
在 OS X 上,您可以将其编译为 .app,这是一个特殊的文件夹,其行为类似于单个可执行文件。我想这在每个平台上都会有所不同,也许最好的解决方案是寻找一些跨平台框架,它也可以捆绑基于 WebKit 的浏览器视图,这样您就不必处理不同的浏览器以及它们如何访问外部各个平台上的文件。
写完这篇文章后,AIR 可能能够捆绑文件,并且它有一个
StageWebView
控件,可以显示 HTML 内容(不确定是否在内部显示 Flash)。On OS X you can compile it into an .app, which is a special folder behaving like a single executable. I guess this is going to be different on each platform, maybe the best solution is to look for some cross-platform framework which can also bundle a WebKit based browser view so you don't have to deal with different browsers and how they access external files on each platform.
Having wrote this, AIR might be able to bundle files and it has a
StageWebView
control which can display HTML content (not sure about displaying Flash inside).