With all due respect, absolutely DON'T do it this way. You're on the right
track, but you haven't fixed the problem.
It all comes down to the question of: from what context is the kill command
issued?
In your fix here, it is still being called from the context of the MIAW,
and if the MIAW kills itself before it is done, then you have a crash. I
know you are telling the stage to do it, but when the call to the stage is
done, where can it return to? Certainly not the MIAW that did the call,
for it's gone.
The only proper and safe way to do this is something to the effect of:
(issued by MIAW):
global gWindowToKill
gWindowToKill =the activeWindow
Note that no actual killing takes place. It just sets a flag/variable to
request a kill in the future.
(in the main movie, or whoever it was that launched the MIAW:)
on idle (or use exitFrame, but something on a regular basis)
global gWindowToKill
if not voidP(gWindowToKill) then
forget gWindowToKill
gWindowToKill =VOID
end if
end
This way waits until the program is operating in the context of the stage,
or really ANY window other than the MIAW, and then kills the MIAW in
question. Safe, effective, not hazardous to the environment.
- Tab
At 09:32 AM 5/17/01 +0100, Paul Fletcher wrote:
>Hi Ravi,
>
>I had this problem a while ago. It is nothing to do with your MPEG.
>It is the way you are closing your MIAW's.
>Keep the code simple when you close the MIAW
>A simple way around this is to go to and 'end' frame in the MIAW with
>the following code on the exitFrame. If you add any code after the
>'tell the stage' command it will not be excecuted because the MIAW
>does not exist anymore!This is what is causing the error
>
>tell the stage
> closeTheMIAW
>end tell
>
>on closeTheMIAW
> close window "your MIAW name"
> forget window "your MIAW name"
>end closeTheMIAW
>
>add code in the closeTheMIAW handler if need be! It might be worth
>swapping the MPEG with a dummy sprite?
>
>hope this has been any help to you
>
>Past Forward Limited, England, UK
>mailto:[EMAIL PROTECTED]
>http://www.pastforward.co.uk/
[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!]