How to specify the order that FlashBuilder searches for class definitions
I have two Flash Builder projects. Let's call them MainWeb and MainAIR.
MainWeb defines and includes all of the classes for my application including a runtime loaded module that interfaces with our web services. MainAIR's Source Path references MainWeb/src and includes only two unique parts. The first file is of course the root MXML document. The other file overrides a compiled, runtime module defined in MainWeb called DataStreamer. DataStreamer interfaces with our web services for MainWeb and the alternate version of DataStreamer interfaces with the OS filesystem for MainAIR. This makes a very easy to maintain pair of projects and easy to build both the web version and the AIR version of my application.
It has worked well until I needed to add an instance of mx.controls.Image. Image references SWFLoader and loads resource/content swfs at runtime. Some of those resources have executable code, so I needed to do the following:
loaderContext = ne开发者_如何学编程w LoaderContext(); loaderContext.allowLoadBytesCodeExecution = true;
This works well from MainAIR, but raises an error in MainWeb because of course allowLoadBytesCodeExecution is only available to AIR projects. So, I thought I could use the same technique I used with the runtime module and just define a new version of the class in MainAIR. This failed. FlashBuilder is compiling in MainWeb's version of the class or Flash Player is instantiating MainWeb's version. I can't tell without decompiling the code.
How can I specify the order, which FlashBuilder should search for class definitions?
Interesting solution. Add another Source Path item to the list for MainAIR, and then move MainWeb/src item below the new one. For example, setting the Source Path list of MainAIR to the following resolved the problem:
MainWeb/assets MainWeb/src
精彩评论