I have used Director 7 quite a bit, but am still learning Dir 11.5 as a newbie.
I want to use a MIAW to show a "tutorial" window with buttons that control handlers in the main window. It works in the editing window, but when I run the projector (in Windows XP) it crashes as soon as I try to call the MIAW:
on mouseUp me
sWindow = window().new ("Script")
sWindow.filename = "TeachScr"
sWindow.open()
put "Window should be open"
end mouseUp
I am wondering if I need another Xtra to handle MIAWs?
Any help gratefully received - thanks.
Hi,
Try this
on mouseUp me
if _player.windowlist.getone(window("Script"))=0 then
sWindow = window().new ("Script")
sWindow.filename = "TeachScr"
end if
sWindow.open()
put "Window should be open"
end mouseUp
or
on mouseUp me
sWindow = window().new ("Script")
sWindow.filename = "TeachScr"
sWindow.open()
put "Window should be open"
end mouseUp
on closewindow me
window("window name").forget()
end
sWindow = window().new ("Script") <-- this line seems to have a very minor problem... try removing the space between new and ("Script"). It's in the OP's code and in the responder's code. I haven't tested to see if the code works, but considering the error the OP was getting and I've never seen that exact syntax with the space before, I'd guess that was the problem.
murali_kumar wrote:
Hi,
Try this
on mouseUp me
if _player.windowlist.getone(window("Script"))=0 then
sWindow = window().new ("Script")
sWindow.filename = "TeachScr"
end if
sWindow.open()
put "Window should be open"
end mouseUp
or
on mouseUp me
sWindow = window().new ("Script")
sWindow.filename = "TeachScr"
sWindow.open()
put "Window should be open"
end mouseUp
on closewindow me
window("window name").forget()
end
Thanks, guys!
Sadly, nothing has changed. I have added the extra code suggested by @murali_kumar and removed the space as @josh_chunick
said, but the response from Windows is the same: 'Where is "Script"?'
Funnily enough, I get the same question when I click on another, unrelated button. I'll search around to see if I've put in some stray code.
In the authoring environment, it works fine. No error messages, just does what I want.
Crash: the main "stage" window operates normally, as it did before I developed the MIAW. As soon as I execute the script to open the miaw, the extra window "flashes" ever so briefly on the screen, then both windows disappear immediately.
Thanks again for any help you can offer. This is doing my head in at the moment.
I have had to move to a Windows 7 authoring environment, after Dir 11.5 stopped working on Win XP.
In case the history can help someone work out what is going on:
The miaw has just one text member, which contains hyperlinks to trigger code execution in the main movie, which was working fine in the authoring environment in XP. I've tried adding lots of Xtras, but it made no difference, as described above.
I feel I should post two things here: the answer/s to my problems, and thanks to an outstanding person in this community.
1. So, Sean had a look at my files, and found (a) there was a #deactivateWindow handler lurking in a script which was suddenly closing the app when the window lost focus; (b) the scriptExecutionStyle was set to 9, causing a problem with naming a Window; and (c) inconveniently, I had forgotten to use "save and compact"
2. I hope every regular here knows what an amazing person Sean is. I have never interacted with the guy until 3 days ago, and he generously checked out my files, found the problem and sent them back to me. I will be in his debt for quite a while. My customers will now have a neat feature to the app (a tutorial window containing text with hyperlinks to control what happens in the main window), adding value to what I offer them. Thanks again, Sean!
North America
Europe, Middle East and Africa
Asia Pacific