How to update movie in run time avoiding crash

Dear Psychtoolbox users,


I'm using the toolbox to study motion perception.
My experiment requires to update the stimulus movie
in real time. For example, I used the following loop.

for Loop = 1:1:10
for i = 1:1:40;
compute movie
imagePtr(i) = SCREEN(window,'OpenOffscreenWindow',[]);
end
for i = [1:1:40];
SCREEN('CopyWindow',imagePtr(i),window, rect1,
Rect1,'srcCopyQuickly');
WaitSecs(0.04);
end
end

My computer keeps crashing. I'm using a G4 450 with 256MB
built-in memory and 900MB virtual memory on Mac OS 9.

Any ideas to fix this?

Thank you,

Zhiyong Yang

Department of Neurobiology
Duke University
yang@...