Working with flash flex strategy and problems

Go To


What is the best practice managing huge game project in flash.

After time I found that combining Flex with Flash Professional gives you the best tools for fast developing, working in a big group, and using SVN.

My project is split to Flex library projects and main Flex project.

  • Designers working in Photoshop and Illustrator, then exporting directly to flex or to Flash Professional.
  • Animators working in Flash professional , each one got his own flx folder(it's unzipped fla format, supported from CS5, his data is not binary, so it's better working with SVN), and may create graphic logic classes, finally he export his solution to flex with swc file.
  • Developers working in Flex, are managing the main project, they getting resources from everyone and putting all together, flex are the only place where game logic is handled, along with server communication.

Lately I found two problems working on complex flex components that part of them created in flash pro. I want to put inside my Flex component a movie clip, and inside that movie clip I want to put another flex component.

This what I do: From flash pro I create a movie clip, using command to convert it to flex container and place the flex content holder square inside them movie clip, exporting it to swc and then from flex I add it directly to mxml and even get his preview in flex design mode. This is what I can't do:

  • I can't move flex content using timeline animation, only with code
  • I can't insert flex content inside a movie clip that are sitting inside other movie clip, even if they both are flex containers.

Please tell me what do you think about my strategy and if you know any work around for those problems

2012-04-04 05:19
by Ilya Gazman


I would not use .swcs at all for graphical assets. As you mentioned, you'll have problems accessing stuff generated from Flash. Plus the bigger problem is, that .fla files contain logic too, thus to modify something you will need Flash professional too (and designers tend to create a huge mess in their fla-s, which is a pain to work with). So to make a simple modification, you might need to move forth and back between Flash builder and Flash professional. Plus its a really bad practice to place code in graphical asset files.

I'd suggest the following workflow to keep code and graphics fully separated:

  1. Designers should export every single static (not animated) vector asset in .fxg files. (so for example for a button, you'd have 3 .fxg files: button_up.fxg, button_over.fxg, button_down.fxg) Fxg support is really cool in Flex, you can edit the files directly, and they are really easy to embed. For example you can do this in MXML: <gfx:button_up x="100"/>, or embed it as a SpriteAsset. Note, that these are quite hard to load at runtime, but this is rarely a problem, since .fxg files tend to be really small. For really complex vector assets putting the to .swf files (point 4) is better for performance (or convert it to a bitmap, complex vectors can kill FP easilly). But note, that .FXG has some limits, for example you cant export static text, or have nested 9 slice scaling.

  2. Export every static bitmap assets to .png. You can embed/load these easily in Flex. Do the same with videos (i havent worked a lot with videos, but .flv was OK for me).

  3. For animated vector assets (movieclips made in Flash) make the following: Place the movieclips on the root of the stage in Flash, check "export to Actionscript" & "export in the first frame" in the symbol's properties. Such a bundle can contain all animations for a character for example. Then simply publish this project, and you can then load it, or embed it like: [Embed(source='char1.swf', symbol='run')] private var runcl:Class; These files wont have ANY actionscript code, but sometimes i found, that i need to add some simple logic to them (mostly stop() and play() commands) To do this use the addFrameScript() command.

  4. Use .mp3s for sounds, and embed your fonts directly to Flex. If a graphical asset has some static text, break it apart to vectors.

2012-04-10 23:40
by sydd