I'm not getting it to work.
I can create my two objects in Spring and wire them together in code.
XML snippet:
Code:
<object id="handler" class="com.example.ClickHandler" />
<object id="button" class="mx.controls.Button">
<property name="label" type="String" value="Push Me!" />
</object>
AS snippet:
Code:
var button:Button = applicationContext.getObject("button") as Button;
var handler:ClickHandler = applicationContext.getObject("handler") as ClickHandler;
button.addEventListener(MouseEvent.CLICK, handler.onClickEvent);
And that works just fine. But the minute I add something like this to the application context XML:
Code:
<object id="onClickFunction" class="org.springextensions.actionscript.ioc.factory.config.FieldRetrievingFactoryObject">
<property name="targetObject" ref="handler" />
<property name="targetField" value="onClickEvent" />
</object>
I get a runtime error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.