是否可以动态创建swf文件(其中包含外部内容)的替代方法?

时间:2021-07-24 13:17:09

I'm about to start a project where there will be a Flash application where the visitor customizes a profile with externally loaded images and texts. Then the visitor needs to be able to download that profile as a dynamically created swf with all that external content baked into the swf.

我即将开始一个项目,其中将有一个Flash应用程序,其中访问者使用外部加载的图像和文本自定义配置文件。然后访问者需要能够将该配置文件下载为动态创建的swf,并将所有外部内容烘焙到swf中。

Any ideas how to achive this?

任何想法如何实现这一点?

Thank you!

2 个解决方案

#1


Which aspect are you curious about? The overall workflow of setting up the server-side architecture? Information on tools that can generate SWFs? Or information on the SWF format itself?

你对哪个方面感到好奇?设置服务器端架构的整个工作流程?有关可生成SWF的工具的信息?或者有关SWF格式本身的信息?

As for tools, here are a few options off the top of my head:

至于工具,这里有几个选项:

  • The Flex SDK (i.e. mxmlc) will compile a pure AS3 project with embedded assets. If you've got reasonable control over the server, and don't mind a relatively heavyweight approach, that's probably the most "supported" way to go.
  • Flex SDK(即mxmlc)将编译具有嵌入资产的纯AS3项目。如果您对服务器有合理的控制权,并且不介意相对重量级的方法,那么这可能是最“支持”的方式。

  • SWFMill (http://www.swfmill.org) has its own XML format for generating SWFs and importing assets. It's not quite up-to-date on newer SWF formats, but that may not matter depending on the requirements.
  • SWFMill(http://www.swfmill.org)有自己的XML格式,用于生成SWF和导入资产。它不是最新的SWF格式,但根据要求可能无关紧要。

  • www.swftools.org has a few things that may be useful.
  • www.swftools.org有一些可能有用的东西。

  • haxe.org has several options for generating SWFs.
  • haxe.org有几种生成SWF的选项。

If your question is about generating the format from scratch, all those projects are open-source, and personally, I've found the haxe sources to be the easiest reading. The library you want is http://code.google.com/p/hxformat/. Taking a look at the swf format spec might be helpful as well: www.adobe.com/devnet/swf/.

如果您的问题是关于从头开始生成格式,那么所有这些项目都是开源的,而且就个人而言,我发现haxe源代码是最容易阅读的。您想要的图书馆是http://code.google.com/p/hxformat/。查看swf格式规范可能也会有所帮助:www.adobe.com/devnet/swf/。

Or were you looking for more step-by-step detail?

或者您正在寻找更多逐步细节?

(note: sorry for the lack of active hyperlinks, apparently the system doesn't believe I'm human yet :)

(注意:抱歉缺乏活跃的超链接,显然系统不相信我是人类:)

#2


I believe you would have to create the SWF on the server side and then either

我相信你必须在服务器端创建SWF然后

1) provide the user with a URL

1)为用户提供URL

or

2) dynamically load it in to your application and use it as the target for a button click, or something like that.

2)将其动态加载到您的应用程序中,并将其用作按钮单击的目标,或类似的东西。

There are a number of ways to create SWFs on the server, but that's an area outside of my experience. Maybe someone else can post some better information on it, but here's a link to one approach, to get you started.

有许多方法可以在服务器上创建SWF,但这是我体验之外的一个方面。也许其他人可以发布一些更好的信息,但这里有一个方法的链接,让你开始。

http://www.sephiroth.it/weblog/archives/2006/02/swf_server_side_compiler_with.php

#1


Which aspect are you curious about? The overall workflow of setting up the server-side architecture? Information on tools that can generate SWFs? Or information on the SWF format itself?

你对哪个方面感到好奇?设置服务器端架构的整个工作流程?有关可生成SWF的工具的信息?或者有关SWF格式本身的信息?

As for tools, here are a few options off the top of my head:

至于工具,这里有几个选项:

  • The Flex SDK (i.e. mxmlc) will compile a pure AS3 project with embedded assets. If you've got reasonable control over the server, and don't mind a relatively heavyweight approach, that's probably the most "supported" way to go.
  • Flex SDK(即mxmlc)将编译具有嵌入资产的纯AS3项目。如果您对服务器有合理的控制权,并且不介意相对重量级的方法,那么这可能是最“支持”的方式。

  • SWFMill (http://www.swfmill.org) has its own XML format for generating SWFs and importing assets. It's not quite up-to-date on newer SWF formats, but that may not matter depending on the requirements.
  • SWFMill(http://www.swfmill.org)有自己的XML格式,用于生成SWF和导入资产。它不是最新的SWF格式,但根据要求可能无关紧要。

  • www.swftools.org has a few things that may be useful.
  • www.swftools.org有一些可能有用的东西。

  • haxe.org has several options for generating SWFs.
  • haxe.org有几种生成SWF的选项。

If your question is about generating the format from scratch, all those projects are open-source, and personally, I've found the haxe sources to be the easiest reading. The library you want is http://code.google.com/p/hxformat/. Taking a look at the swf format spec might be helpful as well: www.adobe.com/devnet/swf/.

如果您的问题是关于从头开始生成格式,那么所有这些项目都是开源的,而且就个人而言,我发现haxe源代码是最容易阅读的。您想要的图书馆是http://code.google.com/p/hxformat/。查看swf格式规范可能也会有所帮助:www.adobe.com/devnet/swf/。

Or were you looking for more step-by-step detail?

或者您正在寻找更多逐步细节?

(note: sorry for the lack of active hyperlinks, apparently the system doesn't believe I'm human yet :)

(注意:抱歉缺乏活跃的超链接,显然系统不相信我是人类:)

#2


I believe you would have to create the SWF on the server side and then either

我相信你必须在服务器端创建SWF然后

1) provide the user with a URL

1)为用户提供URL

or

2) dynamically load it in to your application and use it as the target for a button click, or something like that.

2)将其动态加载到您的应用程序中,并将其用作按钮单击的目标,或类似的东西。

There are a number of ways to create SWFs on the server, but that's an area outside of my experience. Maybe someone else can post some better information on it, but here's a link to one approach, to get you started.

有许多方法可以在服务器上创建SWF,但这是我体验之外的一个方面。也许其他人可以发布一些更好的信息,但这里有一个方法的链接,让你开始。

http://www.sephiroth.it/weblog/archives/2006/02/swf_server_side_compiler_with.php