# How to update movie in run time avoiding crash

**URL:** <https://psychtoolbox.discourse.group/t/how-to-update-movie-in-run-time-avoiding-crash/1193>\
**Category:** Uncategorized\
**Created:** [October 27, 2000, 8:21pm UTC](https://psychtoolbox.discourse.group/t/how-to-update-movie-in-run-time-avoiding-crash/1193 "2000-10-27T20:21:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [October 27, 2000, 8:21pm UTC](https://psychtoolbox.discourse.group/t/how-to-update-movie-in-run-time-avoiding-crash/1193/1 "2000-10-27T20:21:56Z")

</div>

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@...](mailto:yang@...)
