When I get large datasets back from the server that could trigger multiple
times, I add them to a WorkQueue which is a simple singleton class. It has
an Array of tasks and a timer that fires every 200ms, it pops the next task
off the Array and executes it. The Task object itself takes a Function and
an Arguments Array. Works exactly like CallLater except it allows non
UIComponents to defer work till the next frame. Pretty useful when you need
to break things up and the work can be paired down to a function call with
arguments.

I believe Alex Harui also had a Pseudo-Threading example on his blog:
http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html


On Wed, Apr 16, 2008 at 5:14 PM, Gordon Smith <[EMAIL PROTECTED]> wrote:

>    Canvas is a subclass of UIComponent. If you break up your lengthy
> computation into shorter chunks, you can also schedule them with Timer.
>
>
>
> Gordon Smith
>
> Adobe Flex SDK Team
>
>
>  ------------------------------
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *markgoldin_2000
> *Sent:* Wednesday, April 16, 2008 3:08 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] Re: A script has executed for longer than the
> default timeout period of 15 seconds
>
>
>
> But I only can use callLater() if I have components based on
> UIComponent. I did not have any luck using it and my components are
> based basically on canvas.
>
> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Gaurav.
> Jain" <[EMAIL PROTECTED]> wrote:
> >
> > If you are compiling with mxmlc, even though the error message says
> 15
> > seconds, the time out actually happens after 60 seconds.
> >
> > Currently there is no way to increase it. You should break down your
> > code using callLater in order to give some CPU cycles to the player
> for
> > screen updates.
> >
> > Thanks,
> > Gaurav
> >
> > -----Original Message-----
> > From: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>] On
> > Behalf Of markgoldin_2000
> > Sent: Wednesday, April 16, 2008 5:49 PM
> > To: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>
> > Subject: [flexcoders] A script has executed for longer than the
> default
> > timeout period of 15 seconds
> >
> > I am getting this error. At this point of my development I am not
> ready
> > to start optimazing code. Are there any options available to
> encrease
> > that time?
> >
> > Thanks
> >
> >
> > ------------------------------------
> >
> > --
> > Flexcoders Mailing List
> > FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
> Groups
> > Links
> >
>
>  
>

Reply via email to