# Odd bug in my in my Lingo

**URL:** <https://forum.kirupa.com/t/odd-bug-in-my-in-my-lingo/144737>\
**Category:** Uncategorized\
**Created:** [April 16, 2005, 6:44pm UTC](https://forum.kirupa.com/t/odd-bug-in-my-in-my-lingo/144737 "2005-04-16T18:44:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imported\_FlashFish](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@imported\_FlashFish](https://forum.kirupa.com/u/imported_FlashFish)\
**Post date:** [April 16, 2005, 6:44pm UTC](https://forum.kirupa.com/t/odd-bug-in-my-in-my-lingo/144737/1 "2005-04-16T18:44:16Z")

</div>

Is this the best place for director stuff (aside from a director forum!) coz I keep putting it here! Anyhoo, what my code should do is grab an image from a webcam (using an xtra, that all works fine) and then put that image in a member called image1. The next time it grabs an image, it should put it in image2. Up to image10, then back to image1. Simple. :-/ It kinda works, but it puts the same image in image1 and image2, and then another image in image3 and image4. I really can’t see why… thanks in advance for any help.

global webcamxtra  
property w  
property h  
property imageNumber

on beginsprite  
imageNumber = 0  
w = 320  
h = 240  
webcamxtra = new (xtra “webcamxtra”)  
webcamxtra.start(w,h)  
webcamxtra.findglobs(0) --disable glob processing to speed up framerate  
end

on exitframe  
–process one frame  
webcamxtra.update()

– inc image number  
imageNumber = imageNumber +1  
if imageNumber \> 10 then  
imageNumber = 1  
end if

–draw the camera image to the right pane  
member(“image”&imageNumber).image = webcamxtra.image()  
go the frame  
end

on endsprite  
put “died”  
webcamxtra.stop()  
end
