>I have a handler that calls another handler. I can embed the 2nd handler 
>in the first one, but I make it separate in case I can reuse it from 
>another script.

I *think* you mean you can have multiple handlers in a script. This is 
true. If you're thinking of Pascal-style local procedures, no, you can't do 
that in Lingo.

>Instead of letting the globals floating around when the program is 
>running, is there a way to kill it after it's done. I don't know if 
>properties would do it

Globals are around as long as your movie is running--they even hang around 
if you go to or play another movie.

Properties are one way of doing it, if you're using OOP. When you dispose 
of an object, its properties are removed from the heap.

Another way of passing values is via parameters. Say you have a sprite with 
this behavior attached:

property pAlive


on beginSprite
   pAlive = TRUE
end

on mouseUp me
   myPos = sprite(me.spriteNum).rect
   call (#showGloss, script "Chapter Display", myPos, pAlive)
end

This way myPos is strictly a local variable--its memory is available as 
soon as the mouseUp handler finishes. pAlive, on the other hand, stays 
around as long as the playback head is in the sprite span.

Hope this helps.


Cordially,
Kerry Thompson
Learning Network


[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