Reputation: 18599
We have a program that produces several SWF files, some CSS and XML files, all of which need to be deployed for the thing to work.
Is there a program or technique out there for wrapping all these files together into a single SWF file?
Upvotes: 2
Views: 1888
Reputation: 2191
using flex to easily embed them is a good way to go, and if that doesn't sound like fun, think of it this way - XML and CSS data is really just a big long string - so hard-code the string data as a variable inside of your project, and use it as normal.
Upvotes: 0
Reputation: 132862
If you use the Flex compiler (mxmlc
or FlexBuilder) you can embed SWF files and create them at runtime, more or less like you would create any display object:
package {
public class Assets {
[Embed(source="another.swf")]
public var another : Class;
}
}
The code above embeds the file another.swf
and makes it possible to create it in another SWF, like this:
package {
import flash.display.Sprite;
public class MyFancySite extends Sprite {
public function MyFancySprite( ) {
var theOther : DisplayObject = new Assets.another();
addChild(theOther);
}
}
}
CSS, XML and any other file can be embedded in a similar fashion. Here's a description: http://livedocs.adobe.com/flex/3/html/help.html?content=embed_4.html
Upvotes: 1
Reputation: 155
You can use the flex sdk and the [EMBED ] tag for all those files, as for the xml and css you can just compile them in the wrapper swf produced by flex. It works by having a 'skeleton' mxml file that will be injected with the css and xml, and then embed the swf files.
Upvotes: 0
Reputation: 23702
I think you can just drag them into the library of your main swf and make references to them. At least the other SWFs you can, not sure about the CSS and XML.
Upvotes: 0