问题
In AS3, I know how to accomplish this. One needs only to click "ActionScript Settings", and navigate to the SWC file under "SWC Files or Folders Containing SWC Files".
However, when the project is set to AS2, the "Actionscript 2.0 Settings" is a rather sparse menu, and adding the folder as a classpath doesn't seem to work.
Can this even be accomplished?
回答1:
Assuming that your SWC was created for AS2 as a compiled component, you have to add it to your Flash components folder. For me, using CS4 on Win7 the path is:
C:\Users\USERNAME\AppData\Local\Adobe\Flash CS4\en\Configuration\Components
Once this is done, restart Flash and the component SWC should be visible in the Components panel of the IDE. Drag it to the stage and then delete it, which will leave a copy of it in your library. You should now be able to access the classes within the SWC in code.
Source (also contains instructions for SWC creation which is beyond the scope of the question)
来源:https://stackoverflow.com/questions/4089072/how-do-i-include-a-swc-in-an-as2-flash-project