1 Reply Latest reply on May 12, 2013 10:22 AM by DachFlach

    Override SWC classes in FB?

    DachFlach Level 1

      I have a Flash Pro project with numerous items in the Library linked to Class files.


      I can successfully export a SWC and use the items in Flash Builder.


      However, how would one override the Class in the SWC with a new one n FB?


      Currently, to edit the Class, I have to open up the project in Flash Pro, edit the Class and export the SWC again. Only then will I see the changes.


      When I try to put a new Class in Flash Builder with the same name as the one in the SWC, it will run that new Class but the assets of the Library item are not there.


      Hopefully I am missing something obvious.

        • 1. Re: Override SWC classes in FB?
          DachFlach Level 1

          This is a working hack  but   I would still prefer a better way!


          In Flash Builder I create a Class that is near-to but not exactly the same as the original Class from the SWC.

          In this Class I make it extend the original Class in the SWC.



          Class in SWC: SomeClass.as

          Class in FB: SomeClassExt.as


          In SomeClassExt I use:

          public class SomeClassExt extends SomeClass{




          I still need to test this out further but so far so good. Obvious or not.


          One thing I should mention, at least with my current example I need to remove a listener or the Class fires twice:



          So why do I not remove the Class from the Library item in Flash Pro to begin with?

          I built all the items and their Classes in Pro. Moving to FB for this project is recent.

          I can still test the functionality of the Classes in Flash Pro doing it this way and Not have to put them all in the same project folder in FB.


          Again, I would still prefr a better way to just override the SWC's Class and not have to create new Class Names in FB. This requires a lot of changes to an otherwise functional application.