"Script Error: Object Expected" probably means that 'cveta'
is not a color object. this will happen if the following line
cveta = member ("colorgama").image.getPixel (hto, mto)
So, what you could do is test that cveta is a color before
calling hexString() method of a colour object:
strHexCode = ""
if cveta.ilk= #color then
strHexCode = cveta.hexString() & ""
Incidentally, you probably should not write lingo code like
"repeat while the stilldown" (since absolutely nothing else will
happen while the mouse is down -- eventually, sounds will stop and
director will grind to a halt). A better strategy is an
'asynchronous' approach like this :
on enterframe (me)
if (the mouseDown) then
mouseTracking = true
-- track the mouse etc
else if mouseTracking then
-- finish tracking
mouseTracking = false