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