What you are now seeing should be like the graph appearing all at once after some "thinking time", e.g. it blocks other animations/code exectuion during this for-loop (Unless I´m not up-to-date with the screen-refresh-behaviour of the MovieClip.lineTo-method) Now adding a while-loop will only increase the time needed to execute the whole for-loop, but it will not change the fact that the screen is refreshed after all your code has processed, e.g. the whole graph has been drawn.
An Interval will get around this issue, because it will not block any other code running (it´s asynchronous to your other timelines), and will update the screen after every execution. Thus it´s the only way to make the graph look like beeing drawn. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ville Walveranta Sent: Saturday, June 10, 2006 9:11 AM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Slowing down the action (problem with a pause) Thanks for the response, André! The problem with replacing the for-loop with an interval is that the array graph_coordinates contains plenty of data both before and after the segment that is to be visualized. Thus, if the delay is, say, 500ms per loop, there will be several seconds of delay both before and after that graph is drawn. If use of an interval is the only solution (why doesn't a while-loop work as in my initial example?), I may have to pre-process the data into a temp array that'll contain only the segment of data to be graphed, and then pass the data to the interval. Ville -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of André Goliath Sent: Saturday, June 10, 2006 01:50 To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Slowing down the action (problem with a pause) I can´t see your problem using an Interval here. In fact I don´t think there is any way around an Interval or onEnterFrame loop if you want to achieve a "drawing effect". First get rid of the For-Loop, thats what gets replaced by the interval. Then make sure you pass all neccessary parameters to the interval. That are all parameters that do not get changed during the calls. Finaly, make graph_coordinates an static/otherwise "global" array and pop out one coordinate on every call of the interval. On every interval step you process only this single coordinate. If your array is empty, clear the interval. hth _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com

