• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Using external libraries with Actionscript Project

New Here ,
Aug 23, 2011 Aug 23, 2011

Copy link to clipboard

Copied

Hi,

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:

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

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!

-D

Views

388

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 24, 2011 Aug 24, 2011

Copy link to clipboard

Copied

Check  linkage type in Build Path for project Launcher when you add Swc folder. It has to be merged into code.

If it is external, you'll see this error.

That aside, why not do "add project" instead of "add swc folder"?

-Anirudh

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 24, 2011 Aug 24, 2011

Copy link to clipboard

Copied

LATEST

OK thanks, wish I would've asked earlier

I'm using a big hodgepodge of custom libraries and open source stuff, so I'd like to just have what I need in one big lib folder and be done with it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines