You might want to look at Alex Harui's pseudo threading example:
http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html

-Kyle

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Blake 
Barrett
Sent: Tuesday, August 19, 2008 1:16 PM
To: [email protected]
Subject: RE: [flexcoders] Optimize with callLater() -- help?

I'm still fumbling my way through framiliarizing myself with callLater, but 
from what I've been able to do with it, it works perfectly.
As I understand it, you can call a method if you don't have any parameters in 
it like callLater( doSomething ); but if you can't do that you can throw an 
inline function in there like this:

callLater ( Function () : void { doSomething( firstParameter, secondParameter, 
thirdParam[i], whateverElseYouWantToUse ); } );

That may be considered ghetto, but it works for me.

Blake

________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of David 
Ham
Sent: Tuesday, August 19, 2008 11:11 AM
To: [email protected]
Subject: [flexcoders] Optimize with callLater() -- help?

I'm building a room layout application, and one of its features is
that you can create a PDF printout of your project. I'm using AlivePDF
to create the PDFs in the Flash player.

The app needs to create PDFs of many pages, and each page takes awhile
to create. what I just started seeing today is that it times out
before it can create all the pages.

My general routine is that I have a print view class that's a
container for the pages. Each room in the project gets a page, so for
each room, I set the print view to show that room, invalidate the view
with validateNow(), create the image, and pass it into the PDF.

I figure I can cut the createPrintout() method into a few different
methods, but for whichever method calls these smaller ones, how do I
keep it from timing out before all the pages are created? How can I
use callLater() to spread this work out so that this process (which by
its nature takes awhile) doesn't time out?

Many thanks for any advice you can offer,

OK
DAH

Reply via email to