So looks like the only way to monkey patch when using libraries is just to have copies of all the mx.* monkey patched files in ALL projects. Only be doing this will the compiler be happy and it doesn't consider those files as duplicates.
--- In flexcoders@yahoogroups.com, "tntomek" <tnto...@...> wrote: > > 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) >