tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/350-how-can-i-force-flex4-state-component-to-be-mediated-immediately-onregister-is-firing-too-lateRobotlegs: Discussion 2018-10-18T16:35:19Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/37951662010-11-14T23:13:54Z2010-11-14T23:13:54ZHow can I force Flex4 state component to be mediated immediately? (onRegister is firing too late)<div><p>onRegister() is delayed by this line: <a href="https://github.com/robotlegs/robotlegs-framework/blob/v1.4.0/src/org/robotlegs/base/MediatorBase.as#L72">https://github.com/robotlegs/robotlegs-framework/blob/v1.4.0/src/or...</a></p>
<p>You could try overriding preRegister() and making it call onRegister() immediately.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/37951662010-11-15T04:19:58Z2010-11-15T04:19:58ZHow can I force Flex4 state component to be mediated immediately? (onRegister is firing too late)<div><p>Thanks Shaun! Simply overriding preRegister did the trick.<br />
</p>
<p>Looking briefly at the source code you provided, it looks like the only thing I'd have to be careful is trying to bind or set anything on view elements in onRegister, since the view wouldn't have finished being created before onRegister was called.</p>
<p>I think I'm ok there since I'm not setting anything on the view in onRegister but are there any other hidden gotchas that I might be missing?</p></div>rickcr