>hey list --
>simple question.. i thought i saw something a while ago... a simple toggle
>using a "not" to swap sprites but i am really getting the syntax wrong. can
>anyone help? heres the code
>
>on mouseUp me
>   member("music_on").name = not member("music_off").name
>end
>
>i know i am not calling the sprites right but i have spent a good portion of
>the last 2 hours looking for where i saw the reference and have come up
>empty. thanks


Note that the above statement using the Name property will not switch 
cast members, only change the members' names.


About "not":
"Not" can only switch between 1 and 0 (True and False). "not" will 
work best with statements that toggles True/False conditions, like

on exitFrame me
   the visible of sprite(me.spriteNum) =\
   not the visible of sprite(me.spriteNum) -- Blinking sprite!

   go the frame
end


However, if you know you are using members 10 and 11 you could create 
a True/ Flase condition by offsetting the member numbers:

on mouseDown me
   sprite(me.spriteNum).member = \
     not (sprite(me.spriteNum).member.memberNum - 10) + 10 -- Mem 10 or 11
end


The problem is that you need to hard-code the member number. If you 
want a more general script (that works with any combination of 2 
members in sequence) here's a modified version of JHM's suggestion:

on mouseDown me
   sprite(me.spriteNum).member = sprite(me.spriteNum).memberNum\
   + [1, -1][sprite(me.spriteNum).memberNum mod 2 + 1] -- Toggling member num
end


-A.
[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!]

Reply via email to