in JS syntax, I believe there is a difference in terms of how symbols
are handled. They become actual object instances (I believe, Tom slap
me upside the head if I'm wrong). Therefore you are comparing two
different instances of the symbol both having the same visible
"value".
Therefore it is often better to check the string representation of a
symbol in a comparison. I tend to force either to lowercase or
uppercase in order to eleminate the chance that Director will screw up
the case of the symbol (since Lingo comparisons of symbols and strings
are case-insenstive) it is often easy to forget that JS is case
sensitive comparison.
just a footnote:
an alternative approach to comparing strings would be to have a tiny
lingo moviescript in your movie, with a handler like:
on lingo_compare (a, b)
return (a=b)
end
in your javascript code you can then just use:
if (lingo_compare(member("txt").type, symbol("text"))) {...}
notice:
lingo_compare doesn't actually return true/false (in terms of JS), but
1/0, but in code like above the difference doesn't matter, only if you
would use threepart operators like "===" or !==.
other usefull handlers to put into this moviescript for "enhancing" the
capabilities of JS could be
on lingo_do (str)
do(str)
end
on lingo_value (str)
return value(str)
end
then you can e.g. create lingo lists in your javascript with code like
var myList = lingo_value("[1, 3, 5, 23]")
valentin
[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!]