2 Replies Latest reply on Aug 24, 2011 8:29 AM by Dr.Hammer4321

    Using external libraries with Actionscript Project




      I've hit a bit of a brick wall trying to do something that I figured would be a relatively simple task. I'm working on multiple projects and I'm trying to build a number of SWC libraries shared between a number of Actionscript projects using Flash Builder 4. The projects using the SWC's build just fine, but yield this error when run:


      VerifyError: Error #1014: Class <whatever> could not be found.


      Here's a simple example:


      1) Create a new library project.

      2) Add a new Actionscript file in the "testpackage" package.

      3) Slap this code into that file:

      package testpackage
          public class stuff
              public function Testing():void
                  trace("Oh yeah!");


      4) Create a new Actionscript Project named Launcher

      5) In "Properties->Actionscript Build Path", hit "Add SWC Folder" and browse to wherever the library project gets built to.

      6) In the AS file that's generated, add code something like:


          import flash.display.Sprite;
          import testpackage.*;
          public class Launcher extends Sprite
              public function Launcher()
                  var s:stuff = new stuff();


      7) Run this bad boy.


      I get the above error and I have no idea why. Everything builds fine so I'm not sure what I'm doing wrong. I read somewhere that you can manually extract the .swf file from the generated .swc and load that explicitely in code. This is a pretty horrible workflow and I hope it's not the answer


      Thanks a ton in advance!