Try debugging LayoutManager doPhasedInstantiation. Maybe there is an exception being thrown.
as i wrote:
After about 3 minutes (this is the problem this is too long) currentFrame is 2 and im getting to LayoutManager.as:doPhasedInstantiation which being called and run smoothly 7 times and exiting.
any other idea where it could hangs?
is the INIT_PROGRESS event triggers a call to the nextFrame() function? why the currentFrame variable is not being incremented for so long?
another thing that might be helpful is that the browser (which run only my app) has a lot of network activity in this phase. cpu consumption is around 0%.
another question would be, is there any way getting all actions remain in a frame so i can know which action hangs? as you wrote in the nextFrame description in MovieClip class:
"Sends the playhead to the next frame and stops it. This happens after all remaining actions in the frame have finished executing."
I opened wireshark and check what the hell its doing. well, apperently its downloading the swf. but should it be done after im getting the INIT_PROGRESS event? what can i do to show the user a correct info?
I think the SWF has to be downloaded in order to switch to frame 2.
Then in a working app, doPhasedInstantiation gets called at least 3 times and hopefully less than a dozen, and the last one should cause the creationComplete event to fire from the app, which should cause the progress bar to go away.
If doPhasedInstantation never gets the app to fire creationComplete but stops getting called then you probably have to look closer at the logic that resets doPhasedInstantiation to getting called again.
Thank you very much alex for the response.
I found the problem which is google app engine sends me the swf in chanks and after the first one the preloader think it finished to download the app and start the initializing thus giving false info to the user. does flex preloader know how to handler chanked download? can i do anything to support it?
Hmm. SWFs are expected to stream when served over HTTP or HTTPS (but not file://). The SWF header says how many bytes are expected. I didn't think you could fool it. There are two frames in a Flex SWF. Usually the first frame is much smaller than the second frame. After the first frame is downloaded, the preloader starts up while the second frame downloads. Only after all the other bytes are downloaded should the code would switch to frame 2. Have you tried tracking ProgressEvents to see if the player thinks all the bytes are downloaded?
yes, it stops tracking PROGRESS event after 3.5 MB (while my app is 16MB, guess its the first chunk). can you tell me what sends me the PROGRESS events? maybe i can reregister it to keep send me the evnet and ill calculate how much left?
Your preloader is a DisplayObject so root.loaderInfo should dispatch the ProgressEvents. Maybe you can control the chunk size or disable chunking?
no.. its google app engine and they dont allow to disable it/control it. cant you think of any workaround i can do so i keep getting the PROGRESS event while it keeps downloading? i guess something over the loaderInfo stops sends me the events after the first chunk.
ok i found a workaround:
1. unregister INIT_PROGRESS after setting the preloader.
2. adding a listener to the PROGRESS in the preloader every time the event fires (renewing the event in the preloader in each chunk).
3. checking bytesLoaded in the loaderInfo and if it coming close to the swf size adding the INIT_PROGRESS event again so it will dispatch in this chunk.
thanks for your help!
btw if you see any cons to this workaround please tell me (a verification from you that it is ok will also be wonderful).
I"m not sure I understand what is really going on. It sounds like all the bytes do get downloaded but some other code is not dispatching events. Don't know if it is the player or Flex code. If it is working for you, then that might be good enough for now.