tags:

views:

385

answers:

4

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?

A: 

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.

UltimateBrent
These files are being generated by another program, so no FLAs to manipulate.
Evan
Sorry, then I think they'll have to be separate. You could create a wrapper FLA yourself, but depending on how those SWFs interact, I'd be surprised if that worked.
UltimateBrent
A: 

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.

Pedro
+1  A: 

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

Theo
A: 

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.

matt lohkamp