Flash Builder - How to build or include an SWC

前端 未结 5 1888
太阳男子
太阳男子 2021-01-15 16:24

I\'m trying to recreate a modernized version of this tutorial here - but I\'m having problems building and referencing a SWC file for inclusion in my Flash Builder project.

5条回答
  •  迷失自我
    2021-01-15 16:48

    You can build a swc from Flash Builder by creating a Library project as Emanuil also answered already. Normally, all classes that are in the source path of the library project will end up in the swc and those classes are then usable in another project that has the swc in its library path.

    Another way of creating a swc is by using Flash, publishing not only to a swf but to a swc too (it's a checkbox in publish settings). Then all library items that have "Export for ActionScript" checked and a class name, will end up in the swc for use in another project.

    You reference classes from the swc exactly the same as you would reference a class in your own source path:

    // this should be the package and class name of the class you need: 
    //   not the name of the swc it comes from!
    import some.package.name.ClassFromSWC; 
    
    ...
    
    new ClassFromSWC();
    

    Hope this helps...

提交回复
热议问题