0 Replies Latest reply on Mar 22, 2010 5:32 PM by tntomek

    How to monkey patch using multiple libraries?

    tntomek

      Seems like monkey patching works when everything is included in 1 project but not when using libraries. What happens when I have 2 projects and monkey patch is in other one.

       

      i.e.
      MainAppProject (contains MainApp.mxml)
      -SomeLibraryProject (this has the monkey patch code, i.e. Button)

       

      Now in my MainApp.mxml I'm unable to reference my version of the code.

       

      I understand if I use RSLs I can force load my class first so runtime would work, but how do I get compile time access to this class? What if I added a new property (in library project) and I want to access that property from MainApp? The compiler has no idea and I can't build. This forces me to make the monkey patch class implement some interface that would guarantee compile time changes, but this is getting way more complicated then it needs to. Any other ideas?

       

      -Tom Gruszowski (http://tomek.me)