There are entirely different ways you could work. Why not use the 
sprite's number to index into the list, and therefore not need to use 
a symbol of the member name to get at the state at all? For example, 
if your shaped sprites are in channels 101 to 200 (50 states and 50 
countries) you would do this:

global gStateCaps

on mouseenter
    set currState = the currentspritenum - 100
    put getaprop(getat(gStateCaps,currState),#capital) into field "CapitalText"
    put getaprop(getat(gStateCaps,currState),#state) into field "StateText"
end


Your list would have entries like this:

[[#state: "New York", #capital: "New York"],[#state: "England", 
#capital: "London"]]


(sorry for the confusing US example!)

I think that way you can do it all in those three lines, and it won't 
matter that you're using strings with spaces, because you're not 
relying on the symbol from the cast member name.

As for dot syntax, it can make some things like this look very short 
and nice (like me). Here's the same lines with dot syntax:

on mouseenter
    set currState = the currentspritenum - 100
    put gStateCaps[currState].capital into field "CapitalText"
    put gStateCaps[currState].state into field "StateText"
end


The [] does the same job as getAt(), and the .symbol part does the 
same as getAProp().


All this was typed without testing, but it might even work!



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]

Reply via email to