1 person found this helpful
So you have your first MIAW playing successfully. It has a window name (the name you gave it when you created the window object). You can test for the existence of a window with this name using the
function. You can also ask the MIAW which Director file it references. I would approach your question something like the following (based on our previous interaction)
on mouseUp me
a window object already exist?
-- it does, so is it playing "MIAW_1" or "MIAW_2"?
tWindow = window
"MPG") -- store a reference to this window to save typing
if tWindow.filename =
-- it's playing the first MIAW, have it play the second one
tWindow.filename = "MIAW_2"
-- move it to the front (or make it a #tool window so that it's always there...)
-- since there are only 2 Director files for it to be playing
-- it must be playing the second file, so it's time to close and forget the window
-- create a new window object and give it a nametWindow.moveToFront()
tWindow = window().new ("MPG")
-- point it to an existing Director file
tWindow.filename = "MIAW_1" -- no .dir extension required
-- decide where to place it on screen
tWindow.rect = rect(0, 0, 200, 300)
-- open it
-- if necessary:
You could also make do with a single Director file for your MIAW and swap the filename of the member of the sprite that displays video (details depend on what #type of member you're using to play video), but you'd need to resize the window object (change its #rect) - and possibly the sprite's #rect - when you do so.
Hmmm, right off...Director doesn't like this:
Script error: Variable used before assigned a value
Otherwise, post your script
It's Lingo, copied from Seans note above.
Today I'm getting something different. For hours yesterday before I posted the reply, I tried the above Lingo over and over - getting the same error every time. Went back to what I had working, then re-pasted it, same thing. Tried taking pieces out, starting from scratch with new movies, over and over the same thing. Re-started Dir. numerous times, re-booted the computer, finally, I re-installed Director... but nothing changed.
Then...today I'm not getting the error. Just getting what I had before - 1st click brings up MIAW_1, 2nd click closes/forgets it, not swapping in 2nd movie. Maybe Director 11 is playing games with me...I just don't have the $300 to upgrade to 11.5 right now...
There are 4 scripts in my test movie (main.dir):
- go next on the next button
- go previous on the previous button
- go to the frame at 3 separate marker positions
- the MIAW script above on the "movie" button
There are 2 dir. files in the same folder as the main movie : MIAW_1 and MIAW_2
Think I must be real close with that nice script...but something else is wrong. Very much appreciate efforts to help. Thanks.
Dir. 11, Mac os10.5.8