How to monkey patch or override a swc class in Flex?

后端 未结 1 899
你的背包
你的背包 2021-01-26 02:17

I\'m using a swc from the Axiis project to display visualizations in a project I\'m working on. I\'ve run into a bug where re-compiling the library swc would be an easy solutio

相关标签:
1条回答
  • 2021-01-26 02:42

    I'm not sure if you are allowed to do the following: put the class with your fix in the source path of your main application. If you make sure the package and class names match exactly with the original class, the compiler will pick this class up instead of the one in the library. We do this often when we want to patch the Flex framework without having to compile the libraries ourselves.

    Another idea might be to use AS3Commons-Bytecode to create a proxy of the class you want to fix and then have your code work on the proxy instead of the original instance. This is a pure runtime fix. It's a bit more advanced and it will only work if you can somehow get the proxy to replace the original instance of the class you need to fix.

    0 讨论(0)
提交回复
热议问题