Early context initialization to let the bootstrap take place while preloader is visible
I am using robotlegs 1.5.2 with flex 4.6. I have created a preloader which extends SparkDownloadProgressBar. I want the preloader to be visible while some bootstraping of the application is taking place e.g. loading font, external initial data etc. To do this I override initCompleteHandler method of preloader, which stops dispatching of Event.COMPLETE (as soon as this gets fired, preloader will hide). After exploring the Context.as I find that it listen for onAddedToStage event. How can I get context to run the autostartup while preloader is still active ?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
Support Staff 1 Posted by creynders on 24 May, 2013 04:43 PM
I don't get it. If you overrode the initCompleteHandler, isn't the preloader shown automatically while the context does the autostartup?
2 Posted by Chetan Sachdev on 26 May, 2013 08:42 AM
No, the context doesn't autostartup. I have defined it in fx:Declarations section. Should I define it on some flex application event ?
Support Staff 3 Posted by creynders on 26 May, 2013 05:48 PM
Could you post the context initialization code? Normally it autostarts.
4 Posted by Chetan Sachdev on 27 May, 2013 08:37 AM
In my main application, I have added:
<fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> <mvcs:ApplicationContext contextView="{this}"/> </fx:Declarations>and ApplicationContext looks like below:
'
public class ApplicationContext extends Context
{ public function ApplicationContext(contextView:DisplayObjectContainer=null, autoStartup:Boolean=true) { super(contextView, autoStartup); }
Support Staff 5 Posted by creynders on 29 May, 2013 05:52 AM
Hi, not sure whether it's the cause, but shouldn't it be
?
Support Staff 6 Posted by Ondina D.F. on 10 Jun, 2013 11:39 AM
Hi Chetan,
I'm assuming this is resolved. Feel free to reopen this discussion in case you have more questions or you need further assistance with this issue.
Ondina D.F. closed this discussion on 10 Jun, 2013 11:39 AM.