So I ported my project from Flex 3 to Flex 4. I'm trying to simply load a module in an application and setup its mediator to use it. I keep getting this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
I was reading on the adobe forum about this and they said in response to someones similar issue:
The main point of modules is to make the main application SWF smaller. When using modules you have to realize that any mention of a class in the application code links in those classes and all dependent classes. We sort of assumed that folks knew that and have made changes to the styles system in Flex 4 that require that you know that.
And again, in reference to someones specific problem:
You are using the module class in the main app which sort of defeats the point of having a module as it will link testModule into the main app. When that happens in Flex 4, the styles don't get set up properly. You should use an interface instead of the module class.
The basic idea I gather is that you cant reference the module view component in any other code. Which brings me to a lot of problems and two questions:
1. Is that true?
2. If it is, how do I strongly type the view component in the mediator? Do I have to write an interface for every module?