This content has been marked as final. Show 3 replies
it's not possible the way you want. When you read the dozens of threads you find by searching for MIAW, you'll realize that a MIAW cannot close itself. When your MIAW is done, make it set a global flag, and check for that flag in your stage movie.There you can then close and forget your MIAW.
Yes, this can be done, but not (easily) by adding code to the handler
that opens the window. Instead, place the following scripts in the MIAW
Before that though, a couple of points about the code you posted: once
you've set a window's rect and opened it, you don't need to make it
visible. And you should drop the extension from the filename - it's not
required, and if you protect or compress the file to dxr or dcr your
code will break. And you should provide a path to the file too:
on mouseUp me
w = window().new ("miaw")
w.fileName = "@/home"
w.rect = rect(500, 0, 1000, 768)
In home.dir, add the following, as a #score script, to the sprite that
plays the video. I'll assume it's a QuickTime file it plays - if not, be
on beginSprite me
my = sprite(spriteNum)
myDuration = my.member.duration
on exitFrame me
if (my.movieTime >= myDuration) then _player.activeWindow.close()
Now add the following handler in a #movie script:
And finally create a #parent script, name it "window.closer.class"
(without quotes) and add the following to it:
on new me, aWindow
pWindow = aWindow
t = _player.windowList.movie.timeOut().new(string(me), -1,
on mClose me, aTimer
pWindow = VOID
thanks sean!! that works perfectly!!
does exactly what i needed!