<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" preinitialize="{new Injectee(null); FlexContextBuilder.build(ProvingContext, this)}" addedToStage="{dispatchEvent(new Event('configureIOC'))}" layout="horizontal" > <mx:Script> <![CDATA[ import com.proving.injectee.Injectee; import com.proving.injected.ClassToBeInjected; import com.proving.dispatcher.DispatcherNotExtendingEventDispatcher; import com.proving.dispatcher.DispatcherExtendingEventDispatcher; import com.proving.ProvingContext; import org.spicefactory.parsley.flex.FlexContextBuilder; private var _dispatcher1:DispatcherExtendingEventDispatcher; private var _dispatcher2:DispatcherNotExtendingEventDispatcher; [Inject] public function init(dispatcher1:DispatcherExtendingEventDispatcher, dispatcher2:DispatcherNotExtendingEventDispatcher):void{ _dispatcher1 = dispatcher1; _dispatcher2 = dispatcher2; } ]]> </mx:Script> <mx:Button label="Dispatch Messages" click="{_dispatcher1.dispatchManagedEvent(); _dispatcher2.dispatchManagedEvent()}" /> <mx:Button label="Dispatch Messages with Error" click="{_dispatcher1.dispatchManagedEventWithError()}" /> </mx:Application>