Driven on by curiosity, I’m trying to understand the Life Cycle used by Flex Application.
So, I’ve done a little research on this argument; the two key concepts used into the FlashPlayer are:
- SWF Frame: it’s the logical unit that contains graphical code and as code
- Flash Player Frame: it’s the time interval used by Flash runtime to update the screen and defined by frameRate property
If so, could you explain me the relationship bewteen these two concepts? In particular, are they paired togheter or not?
The main rule is: the Flash Player streams in a swf; until a full SWF Frame is read, the Flash Player cannot render it.
I’ll try to explain what I need to understand. For the sake of simplicity, suppose you have a two frame application: SWF FR 1 and SWF FR 2.
In general (for example in CS4) a frame is considered as a logical unit (delimited by ShowFrame tag) where you can attach as3 code. This as a simplified version of a swf file, i think:
- Header // frameRate is defined here
- Symbols, classes etc… // this is FR1 === ShowFrame ===
- Symbols, classes etc… // this is FR2 === ShowFrame === End
If you have two frame, FR1 and FR2, Flash starts executing FR1 and goes to the next one (FR2). If you don’t stop the excution, the Player executes and renderes code contained into FR1 and FR2 through an infinite loop. On the contrary, when you stop the execution, for example in FR2, the flash player loops executing code contained in FR2.
So, can Flash Player Frames took place many times per SWF Frame?
When FR1 is downloading (FR1 is not fully loaded) is there any enterFrame events or not? Does the first frameEvent take place when the FR1 is fully loaded? During what period of time is FR1 rendered? An other scenario, if you have called the stop command into FR1, you will get enterFrame at the rate you specify (the current frame is FR1). Meanwhile FR2 is downloading. When it’s finished, you go to the next frame (FR2). During what period of time is FR2 rendered? Does Flash Player try to render FR2 to its next time interval?
Take in account this simple sequence:
- FR1 is downloading
- FR1 is fully downloaded
- FR1 calls stop() method, meanwhile FR2 is downloading
- FR2 is fully downloaded
- Go to FR2
- FR2 calls stop() method
- And so on
Could you underscore for me when Flash Player enterFrame events take place?
Thank you for your time. Best regards, Flex_Addicted.