|
So I tried to dig up some sort of formal article that described how the Player really operates but it turns out there isn't one. That's something we'll look to rectify but in the meantime here's the high-level overview:
The Player is a frame-based system since it's originally designed for graphics and animation. Whenever you see an animation or a button highlighting for example, multiple frames are passing by showing you different states. One time for each frame the Player will execute code. The entry point into that code is through event handlers which are specified by the Player. Almost all of those event handlers are masked by Flex, instead we provide higher-level events. So, when one of those event handlers fires your code will execute. All ActionScript code executes in a single thread, you are never at risk of two threads running at the same time so there is no such thing as locking or waiting. While your code is executing the Player will not draw either. So if you have a loop that is taking a long time so your code doesn't exit the Player appear to slow down or hang. This is why you might see warnings about a script taking too long to execute. If you want to spread some processing out over a few frames so that your application appears more responsive you can use the doLater function which you can see in the docs.
OK, so what happens when you call a method that is going to send stuff over the network? Essentially the Player will batch up those calls and when your code for that frame has finished (your event handler exits) it will go ahead and make all of those calls. There is no guarantee as to the order of the calls, so if order is important you'll need arrange that yourself by waiting for the first to return before sending the second. As those network calls complete events will fire for you to handle the results. Each call return is its own event; those will not be batched up. And thus the circle of life is complete J
HTH,
Matt
-----Original Message-----
Matt, |
- getURL POST problems Matt Chotin
- getURL POST problems Jonathan Bezuidenhout
- RE: [flexcoders] Re: Remote object method execu... Sean Neville

