What I usually do is to declare an iIteration:int = 0 variable and an
iEndIndex:int = number of iterations instance vars.

 

Then I call a control function, which checks to see if the iIteration is
less than the iEndIndex, and if so, it calls the main work function.
The main work function does its stuff, increments the iIteration var,
then uses callLater to call the control function.

 

Tracy

 

________________________________

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

 

I think callLater() is going to work for me, but I have another
question:

To create my pages, I loop through an array of Room objects. For each
Room, I set it to be the currentRoom, which tells the view to display
that Room's information. I figure I can do this (pseudocode):

for (var i:uint = 0; i < rooms.length; i++) {
model.currentRoom = rooms[i];
callLater( makePageFromRoom() );
}

I figure this should tell the view to update itself, and then the
callLater() should create the PDF page after the view has finished
updating.

But how do I loop through the rooms? Should I do an enterFrame event
listener, and in every frame, set the currentRoom to the new room and
do a new callLater()?

Thanks,

OK
DAH 

 

Reply via email to