Modular Utility causing Error #1065: Variable FooterView is not defined.
I am currently trying to get a module loaded in my application and I am having a issue with the injection. I have created parentInjector property in the document class which then initiates my context derived from the ModuleContext class.
Only when I now try to load in my module I am having the following error:
ReferenceError: Error #1065: Variable FooterView is not defined.
at flash.system::ApplicationDomain/getDefinition()
at org.swiftsuspenders.injectionpoints::PropertyInjectionPoint/applyInjection()
[E:\no_flare_core\workspace\flash\contrib\SwiftSuspenders\org\swiftsuspenders\injectionpoints\PropertyInjectionPoint.as:35]
It's failing for two classes called FooterView and BackgroundView. I am already have a view mapped BackgroundView in the main application. I am capable to create an instance of FooterView in the document class of my module. It's really something strange going on in the injection.
Do I need to load the module in a different application domain?
Comments are currently closed for this discussion. You can start a new one.
2 Posted by Weyert on 12 Jul, 2011 10:23 AM
Mediator mappings in the module:
Looks like its tries to get a definition of the class in the wrong application domain. My SWF gets loaded with the following LoaderContext:
3 Posted by neil on 12 Jul, 2011 10:29 AM
OK, with out digging deep at all, I notice you state:
"I have created parentInjector property in the document class which then initiates my context derived from the ModuleContext class."
(I'm assuming youj are using Joels modular util) The IModule specifies:
function set parentInjector(value:IInjector):void;
so the ModuleContext should be creating the child Injector for you??
can you paste some code?
or if you can't can you paste me some in chat?
4 Posted by neil on 12 Jul, 2011 10:30 AM
Isn't there an ApplicationDomain prop that you can set?
5 Posted by neil on 12 Jul, 2011 10:32 AM
yep, you can pass in an ap domain in the create child
injector.createChild(_applicationDomain)
6 Posted by neil on 12 Jul, 2011 10:34 AM
ok, the Application view is retrieved from the contextView
so the question, what view do you supply to your ModuleConext?
7 Posted by Weyert on 12 Jul, 2011 10:36 AM
My code is the following (ISequenceItemView introduces the dispose method):
}
8 Posted by Weyert on 12 Jul, 2011 10:47 AM
I changed my code with the following code snippet:
and then it correctly creates an instance:
I am not sure what I am doing wrong. The error happens in the following line of code:
9 Posted by Weyert on 12 Jul, 2011 10:51 AM
I am supplying the document class to the module context.
10 Posted by neil on 12 Jul, 2011 11:10 AM
ok, I think we can assume that this is an ApplicationDomain problem.
What we need to determine is if this has anything to do with RL or SS or neither.
Does the error get thrown when a new FooterView is created? or when RL and SS try and automatically mediate it?
ie
var footer:FooterView = new FooterView()
topLayer.addChild( footer );
where does it chuck that error?
11 Posted by Weyert on 12 Jul, 2011 11:25 AM
Yes, I don't have the problem when I kickstart the module without loading into the shell or when I disable the mediator mappings. The code for loading a module is the following:
public function load(contentURL: String):void
{
}
I am not sure what I am doing wrong. The only thing that probably is different that I don't map all the modules which is problematic because I don't know which modules will exist in the future.
Weyert closed this discussion on 18 Jul, 2011 10:20 AM.