See, THAT is what I am talking about - regarding the UI still rendering, while the PrintJob is being sent to the printer. This where I am running into problems - I have an idea on how to get around this - but I need to know which Event to listen for, that directly relates to the Object I am scaling. If I know which Event to listen for, I can set a local flag to 'True' - and if a certain Event fires, with the variable being 'True', then I can dispatch a custom Event, which my Printer Dialog Window listens for. The Custom Component that I am modifying just before the PrintJob runs, extends the UIComponent. I am going to take a wild guess and say that I should listen for the "UpdateComplete" Event - as that should get triggered if I perform a Resize correct? Thanks for your ideas - Mike
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Wednesday, April 02, 2008 8:54 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Question on calling multiple Functions in sequence Unless you are doing something that is explicitly asynchronous, the single threaded nature of AS processing is reliable. The main function does not "know" in any sense, but the execution path is linear. Processing simply does not return to the main function until the called function(s) is/are complete. This does not necessarily mean that the UI is done rendering. That stuff is controlled bu the invalidation system. But code processing is linear. If your wife sends you shopping, she has no idea whether you went to the bar while you were gone, but, assuming you have no bugs (or delegate the shopping to someone else), when you return, the shopping is done. Tracy ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mike Anderson Sent: Wednesday, April 02, 2008 10:28 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Question on calling multiple Functions in sequence Thank you Tracy and Eric - this DOES help me a lot - But I need to ask, what facilities are built into the FlashPlayer, that guarantees that Function2 doesn't run until Function1 not only executes, but actually FINISHES? Doing computations is one thing, but when you are doing scaling functions, or anything else that really doesn't provide any feedback one way or another when it's actually finished (scaling an object in this case), how can the containing function really KNOW? I know these may be novice questions, but these types of issues have been nagging me for a long time. The more I can understand what's really going on under the hood, the more effective of a programmer I can be. Thank you again for all your comments - please keep them coming :) Mike ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Eric Cancil Sent: Wednesday, April 02, 2008 6:34 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Question on calling multiple Functions in sequence When dealing with things inside the flash player - you need to deal with it as if it was single threaded - because generally, it is. In your example, the functions would be called in order, one after another...not all at the same time as you may think so lets say you had an example like this var myNumber:Number = 0; private function doThisFunction():void{ myFunction1(); myFunction2(); myFunction3(); } if function 1 added 10 to myNumber, function 2 multiplied it by 5, and function 3 subtracted 12 - it would happen in that order exactly - and you can count on that - so your final result would be 38 hope this helps eric On Wed, Apr 2, 2008 at 7:54 PM, Mike Anderson <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Hello All, I was wondering how things work, when calling multiple functions in sequence. For example, in this function: private function doThisFunction():void { myFunctionOne(); myFunctionTwo(); myFunctionThree(); } When I execute "doThisFunction", does it literally run the 3 functions "one-two-three", or does it execute the first function, waits for it to finish, then runs the second function, waits for it to finish, then finally runs the third function. How could "doThisFunction" possibly know when "myFunctionOne" even finishes? My end goal, is to create a way for a function (containing more functions within) to stop and wait for each function to "run & complete", before executing the next one. I know Events are used quite often when things must happen in a sequence, but when it comes to things like "Scaling or Sizing a Component", how could I possibly know when something like that finishes? Thanks in advance for any advice you can all throw my way :) Mike