tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/132-error-1065Robotlegs: Discussion 2018-10-18T16:35:14Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/22706762010-07-15T18:49:15Z2010-07-15T18:49:18ZError 1065<div><p>Sorry, click where I shouldn't but the bug is still
occuring.</p></div>WaZztag:robotlegs.tenderapp.com,2009-10-18:Comment/22706762010-07-15T19:55:57Z2010-07-15T19:55:57ZError 1065<div><p>Do both SWF files run fine stand-alone (ie, no errors)? What
versions of RL did they use?</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/22706762010-07-16T13:52:33Z2010-07-16T13:52:36ZError 1065<div><p>If I use Context instead of ModuleContext with the same RL
version (1.1.1) I have another error :<br>
ReferenceError: Error <a href="/discussions/problems/1065" title=
"Discussion #1065">#1065</a>: Variable ApplicationModel is not
defined.<br></p>
<pre>
<code>at flash.system::ApplicationDomain/getDefinition()
at org.swiftsuspenders.injectionpoints::PropertyInjectionPoint/initializeInjection()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/injectionpoints/PropertyInjectionPoint.as:58]
at org.swiftsuspenders.injectionpoints::InjectionPoint()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/injectionpoints/InjectionPoint.as:19]
at org.swiftsuspenders.injectionpoints::PropertyInjectionPoint()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/injectionpoints/PropertyInjectionPoint.as:31]</code>
</pre></div>WaZztag:robotlegs.tenderapp.com,2009-10-18:Comment/22706762010-07-16T14:05:38Z2010-07-16T14:05:38ZError 1065<div><p>Hi WaZz,</p>
<p>It's very difficult to tell what's going on without knowing
more. Would you be able to build a tiny, stripped-down example
(just a couple of files) that replicates the problem you are
having?</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/22706762010-07-16T14:48:13Z2010-07-16T14:48:14ZError 1065<div><p>Here it is</p></div>WaZztag:robotlegs.tenderapp.com,2009-10-18:Comment/22706762010-07-16T15:06:31Z2010-07-16T15:06:31ZError 1065<div><p>Hi WaZz,</p>
<p>That's not really a stripped-down version, but I'll try make
some time to look through it. By stripped-down I meant the fewest
files possible to demonstrate the problem. Anyhow, first thing I
noticed was this:</p>
<pre>
// In ProjectContext, startup:
injector.mapSingleton(ApplicationModel);
var appModel:ApplicationModel = injector.instantiate(ApplicationModel);
appModel.local = _local;
</pre>
<p>The problem there is that injector.instantiate() does not return
a container managed instance - it simply, and forcefully,
instantiates a new instance (ie, it won't be the same instance
injected into other parts of the system). You should be using
injector.getInstance() which will return an instance based on your
mapping. See these asdcos for reference:</p>
<p><a href=
"http://github.com/robotlegs/robotlegs-framework/blob/v1.1.1/src/org/robotlegs/core/IInjector.as#L101">
http://github.com/robotlegs/robotlegs-framework/blob/v1.1.1/src/org...</a></p>
<p>This may or may not be causing problems for you - I'll need more
time to go through your source in full (a little busy right
now).</p>
<p>Also, are you wanting to communicate between these two
contexts?</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/22706762010-07-16T15:17:21Z2010-07-16T15:17:26ZError 1065<div><p>Yes, in my project, I have set an interface</p></div>WaZztag:robotlegs.tenderapp.com,2009-10-18:Comment/22706762010-07-27T21:06:51Z2010-07-27T21:06:56ZError 1065<div><p>Sorry for the delay, but that did not fix the problem....</p></div>WaZz