Pay for Hesitation: Loading Flash Assets from SWC File

Pages

2010年3月19日 星期五

Loading Flash Assets from SWC File

  1. In Flex Builder, create a new AS project.
  2. In the project folder create a new FLA: 'assets/assets.fla'. (the frame script cannot be blank. You should add at least one statement like stop(); )
  3. In the Flash publish settings, check 'Export SWC'.
  4. Create a symbol in the FLA. Set the Linkage id to: 'assets.MySymbol'.
  5. Publish the SWC.
  6. In Flex Builder do Project -> Properties-> ActionScript Build Path -> Library Path -> Add SWC. Enter the path to the SWC ('assets/assets.swc') .
  7. In Flex Builder, edit the main class. Type 'import assets.'. The symbol name you defined in the FLA will now show as a code completion option.

沒有留言: