Jakob, you may recognise the following. It is what started me on the MIAW
closing approach using timeouts. It doesn't work without modification - at
least not with D8/8.5, win2K. This is the same problem that Fumio described
at the start of this thread. What I subsequently posted was the "fix" that
worked for me, as described below. Your code will close the window the
*first* time, but then won't allow you to re-open the same window. "Unable
to open file whatever.dir because it is already open with write permission
... "
> In the Miaw have these 2 scripts:
> (requires D8)
>
> --------<movie script>--------
> on closeWindow
> script("miawCloserClass").new(the activeWindow)
> end
> --------</movie script>--------
>
> --------<parent script "miawCloserClass">--------
> --miawCloserClass
>
> property pWindow
>
> on new me, aWindow
> pWindow = aWindow
> tell the stage to timeOut(me.string).new(0, #dummy , me)
> end
>
> on exitFrame me, aTimer
> aTimer.forget()
> pWindow.forget()
> end
> --------</parent script "miawCloserClass">--------
>
> That should rid you completely of the Miaw... unless you have stored
> references to the Miaw.
Reason: the exitFrame handler of the child object doesn't void the timeout,
thus a mutual reference is maintained between this child and the timeout.
But now, the timeout is gone from the timeoutlist, so stops sending playback
events to the child, and there is no way back to either of these objects.
They persist in RAM with no other pointers to them.
I would further suggest that adding pWindow.forget() to the miawCloserClass'
"new" handler merely defers the problem. The window will close properly and
re-open, but you now have a mutual reference that doesn't also contain a
reference to the MIAW, which is what allowed me to identify the problem in
the first place.
The point of this discussion, for me at least, has been to suggest that when
a timeout is forgotten, it also needs to have its reference voided, or its
target voided.
Modifying the exitFrame handler as follows
on exitFrame me, aTimer
aTimer.forget()
aTimer = VOID -- or 0
pWindow.forget()
end
is all that is required to both allow the window that is closed/forgotten to
be re-opened, but also ensure that mutual references are destroyed.
If you can't verify this yourself, I am more than happy to send you example
files off-list that demonstrate what I'm describing.
-Sean.
[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!]