Justin,
Why are you adding quotes to your hex color string? Let's look at the mouseDown
handler:
on mouseDown me
sprite(1).color = rgb("#FF0000") --works fine, turns sprite red
updateStage --pg. 264 Special Ed. Using MM Dir. 8
--author: Gary Rosenzweig
end
Notice that the value you feed to the rgb() command is "#FF0000", now let's look at
your mouseUp handler close detail (check for the comments I've put in-line):
on mouseUp me
hexN = "FF0000" --same hex value as above
hexNumWsharp = "#" & hexN --adds sharp
-- at this point in your code hexNumWsharp = "#FF0000"
-- notice that it's the same as above, but then you do this:
hexWquotes = QUOTE & hexNumWsharp & QUOTE --adds quotes
-- Why add the quotes? It's already a string. Now we have
-- hexWquotes = "'#FF0000'", which is *not* the same as above
sprite(1).color = rgb(hexWquotes) --returns the sprite color to black
updateStage --what am I missing?
end
When you attempt to convert a string to an rgb value, and that string is not a proper
hex color string, the result returned is black. For example:
put rgb("hello")
-- rgb(0,0,0)
Therefore you can just remove the line of code where you tack on the quotes and simply
pass hexNumWsharp to the rgb() command and you should be alright.
Cheers,
Tom
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]