Right idea, wrong execution. Even this won't work, because it's still in
the context of the window that will be killed. Imagine in your example -
when it comes back from the 'tell the stage', what will it come back
to? The window is gone, it'll die.
Instead, do this:
(from the window you want to kill)
global gWindowToKill
gWindowToKill =the activeWindow
(and in an idle handler or exit frame on the stage, that loops around):
global gWindowToKill
if not (voidP(gWindowToKill)) then
forget gWindowToKill
gWindowToKill =VOID
end if
This way it safely executes from the context of the stage, and safely kills
the window.
- Tab
At 11:19 AM 5/5/02 +0200, Alex da Franca wrote:
>At 8:43 Uhr +0000 05.05.2002, krishnamraju ssvk wrote:
>>dirapi.dll
>>iml32.dll
>>i am calling dxr files into my exe application. i used windows in my dxr
>>movie. when i am closing a window it is giving me problems like invalid
>>page fault in module DIRAPI.dll and invalid page fault in module
>>IML32.dll and closes the application. i tried all types of window closing
>>methods like
>>
>>window(mywindow).close()
>>window(mywindow).forget() and
>>
>>close the activewindow
>>forget the activewindow etc
>>
>>if anyone find solution to my problem please mail it
>>thanks
>
>try to close/forget the window from an event which is not inited in the
>miaw itself, sometimes that's the cause of the problem.
>the safest method is something like:
>
>in the miaw movie:
>
>on closeMe
> w = the activeWndow
> tell the stage
> forgetWindow w
> end tell
>end
>
>
>and in the main movie (the stage)
>
>on forgetWindow win
> global windowToForget
> windowToForget = win
> to = timeout("windowforgetter").new(10, #winKiller)
>end
>
>on winKiller
> global windowToForget
> if ilk(windowToForget) = #window then forget windowToForget
> windowToForget = 0
> timeout("windowforgetter").forget()
>end
>
>not quite elegant, but safe, because the problem is that the event is not
>finished, when you forget the miaw from within the miaw itself.
>
>another thing to be aware of, is a bug which stops all running sounds,
>when forgetting a miaw :-(
>in that case you'll have to store the currenttime of any sound running in
>any soundchannel before you issue the forget command in the main movie and
>restart the sounds at the same position afterwards.
>--
>
> |||
>a�ex
> --
>[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!]
[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!]