This content has been marked as final. Show 4 replies
Have you put any data into gList? Have you tried writing a handler that accepts vColour and vSquare as parameters, and which sets the colour of vSquare to vColour?
If vSquare is a reference to a sprite, the end of your handler could look like this:
case the keyPressed of
"A": vColour = rgb(255, 0, 0)
"B": vColour = rgb(255,128,0)
-- Add other key | color combinations here
vSquare.color = vColour -- assumes that vSquare is a sprite reference
Thanks for the tip I really appreciate it, I had to tweak my code a bit but it works now heehee. However I had another question, don't know if you can help with this again or anyone else at all, is it possible for me to define a range from which the colour can be chosen, for example rgb (255,255.255) to rgb(200,200,200)??....as I’m not sure if Director recognises the colours in-between the two sets I have specified i.e: rgb(225,225,225)?
vRandom = random(200, 255)
vColor = rgb(vRandom, vRandom, vRandom)