Quick tip: Embedded MovieClip not MovieClip?

When embedding MovieClips (with only one frame) from Flash .swf file into your Flex projects, you can fall into runtime issues:

[Embed(source="assets/preloader.swf", symbol="preloader")]
public static const PRELOADER_CLASS:Class;
MovieClip(new Assets.PRELOADER_CLASS());
TypeError: Error #1034: Type Coercion failed: cannot convert *** to flash.display.MovieClip.

Read the rest of this entry »

9 slice scale for bitmaps in flash (no hacks)

9slice_result_flash

9 slice scale is a nice feature, but when you try to use 9 slice in flash ide on MovieClip with bitmap, you will notice a problem. It will just not work as expected. So first thing you try is “Break Apart”, with same result. You are almost there, but due to the solution is not documented you need a small hint: After break apart (ctrl + b), select each of nine slices one by one and group (ctrl + g) individually and voilà its done. See snapshot and result images…

Read the rest of this entry »

Embedding assets wisely

You can embed various types of assets in your Adobe Flex applications (.jpeg, .png, .swf, .mp3, .svg, .ttf …). Embedded assets are compiled into the SWF file of your Flex application. They are not loaded at run time and you do not have to deploy the original asset files with your application. Read more about embedding assets on Adobe.

Basics first. How to make your symbol from Flash library visible for Flex (see images on the bottom of the artice):

  • 1. Create your symbol and linkage (library (Ctrl+L) / {your symbol} / Linkage…).
  • 2. Linkage Properties, set your class name that will be used in [Embed] meta.
  • 3. Export .swf file and make Assets.as.

Read the rest of this entry »