Is it possible to package all external files, such as images and videos, into the final .swf or equivalent file? I want to keep the external files separate because it is easier to change them out while developing, but I don't want them to be external when delivering the project. Does anyone know if this is possible?
-
Zip is not appropriate for what the OP is asking for. Flash apps can load assets dynamically at runtime (use external resources) or they can be embedded in the swf at compile time. With Flex apps and AS3-only apps, assets are embedded at compile time based on files in the OS. But for Flash IDE based apps, the assets are added to the source FLA and embedded at dev time which complicates development. I don't know if the IDE allows embedding assets from the OS that are not in the FLA. You can try using the embed metadata tag in an AS3 source file. – Samuel Neff Jan 22 '10 at 21:05
-
@Sam, unfortunately the embed metatag does not work for the Flash compiler. – sberry Jan 22 '10 at 21:08
-
hi sberry2A, it just doesn't come out of the box, but if using flash cs4 it's possible to use it. It requires some configuration, you can find some info in the link in the answers below. This helps getting some more flexibility when working in projects that are compiled with flash/flex. – a--m Jan 22 '10 at 22:16
-
but you wouldn't be able to use the embed metadata tag dynamically. You would have to know of and code in all of the embed statements for each external file. – nicknisi Jan 25 '10 at 15:24
2 Answers
you can do it with swf, and the embed tag. Check this in case you are working with flash IDE: http://www.adobe.com/devnet/flash/articles/embed_metadata.html
or you can use a swc, which works in a similar way.
Both solutions requiere Flash CS4 or flex compiler as far as I can tell.
You will have just one swf in the end, but consider that for every change you make to the "contents" file (swf or swc) will requiere that you compile again the project.

- 4,716
- 1
- 39
- 59
If you mean you want to develop your fla and have all assets for your swf loaded externally, then when it is time to give the swf to you customer have all of the assets loaded and saved into the swf so it can be 1 file, then no.
First off, the method for loading images, videos, etc from an external source requires different code then it would if all of the assets were compiled into the swf itself. Secondly, there is no mechanism to do this anyway.
As an alternative, you could keep all of your assets in a single separate swf that your main swf loads. Then you would be delivering 2 swfs, one with just the assets. Updating the content during development, however, will be very similar to what would be required if you just kept all of the assets in the main fla to begin with.

- 128,281
- 18
- 138
- 165