A SWF has one or more Frames, and code that dictates when to switch to the next Frame (stop, play, gotoAndStop, etc). A SWF also has an initial frame rate that can be changed later by code.
The player basically had a timer based on the current frame rate. When that timer goes off (or as soon as possible later if the player is busy), the player determines whether to run scripts in the last SWF Frame or a new SWF frame depending on whether the last SWF Frame had any code that called stop.
Most Flex SWFs have two SWF frames (preloader, and app) and, on a slow network, you watch the preloader frame on each frame tick until the rest of the app is downloaded then we switch to frame 2 and you're stuck there for the rest of the duration of the app.
Thank you for your reply!
I was reading about SWF Frames and Flash Player Frame, when I Found your slide presentation "Modules". I really appreciate it!!
P.S. Is there a video on Adobe TV?
Could you explain these concepts with a little example?
I'll try to explain what I need to understand the Frame concept.
For the sake of simplicity, suppose I have a two frames appliacation: SWF Frame 1 and SWF Frame 2.
The rule is: the Flash Player streams in a swf; until a full SWF Frame is read, the Flash Player cannot render it.
First Scenario: without stopping execution
So, when the first frame (SWF Frame 1) is fully loaded, Flash Player can render it.
The first question is: How long does the Flash Player take to load and render SWF Frame 1? In this situation, is SWF Frame 1 paired to Flash Player Frame?
When the SFW Frame 2 is ready, Flash Player can rendere it too.
The second question is: How long does the Flash Player take to load and render SWF Frame 2? In this situation, is SWF Frame 2 paired to Flash Player Frame?
Second Scenario: stopping execution at SWF Frame 2
Assuming there is a stop request in SWF Frame 2, the player will not rewind, but it will continue to execute code containde in both SWF Frame
The third question is: In this situation how long is the Flash Player Frame?
Third Scenario: stopping execution at SWF Frame 1
Assuminh SWF Frames (SWF Frame 1 and 2) are larger than previous ones.
Fourth question: How long does the Flash Player take to load and render SWF Frame 1? In this situation, is SWF Frame 1 paired to Flash Player Frame?
Then, if you stop requested, the Flash Player doesn't try to render SFW frame 2 and reexecutes code in SWF Frame 1.
Fifth question: n this situation, is SWF Frame 1 paired to Flash Player Frame?
Finally SWF Frame 2 completes loading. The player renders SWF Frame 2.
I hope it's all clear!!
Thank you for your patience!!
1 person found this helpful
No video of that presentation.
When a frame is finally downloaded, the player will try to render that SWF frame on its next frame (so it is paired) and it can take "forever" if there are enough code to run and objects to render.
thank you! You're very helpful.
The last question for you!!
The player streams in a SWF to load its frames.
When does the flash player's timer start to? Does it start after the first frame is completely downloaded or not?
Thanks in advance.
Are you referring to getTimer()? I don't know exactly, but it appears to reset to 0 when the SWF bytes start to stream in.
I'll try to explain what i need to understand.
Could you underscore when the Flash Player Frames (understood as the time period between two consecutive enterFrame events) take place?
Suppose an application with two frames (FR1 and FR2) and a specific frame rate
The Flash Player streams in the SWF:
1 Flash Player starts to load FR1
2 FR1 is completely loaded
3 FR1 calls stop() method
4 Flash Player is waiting to load FR2
5 FR2 is completely loaded
6 FR2 calls stop() method
To summarize: Can Flash Player Frames can be took place many times per SWF Frame?
Thank you again
Message was edited by: Bilbo1984
When FR1 is completely loaded, you should get the first enterFrame. Because there is a stop() on FR1, you will get enterframes at the frame rate (unless lots of code and rendering slow it down), and the currentFrame will remain FR1. Meanwhile, FR2 is downloading. When it is finished, unless there is code that switches to FR2, you will remain getting enterframes at the frameRate and currentFrame will remain FR1.
Flex SDK Developer
Adobe Systems Inc.