-
1. Re: Movie in a window basic setup question
SeanWilson Apr 19, 2011 12:32 AM (in response to onefiftymph)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
windowPresent("windowName")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
--doesa window object already exist?
if _player.windowPresent("MPG") then
-- 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 ="MIAW_1"then
-- 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...)
tWindow.moveToFront()
else
-- 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
tWindow.close()
tWindow.forget()
end if
else-- 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
tWindow.open()
-- if necessary:
end if
endYou 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.
-
2. Re: Movie in a window basic setup question
onefiftymph Apr 20, 2011 12:21 PM (in response to SeanWilson)Thanks Sean
Hmmm, right off...Director doesn't like this:
if _player.windowPresent("MPG") thenScript error: Variable used before assigned a value
-
3. Re: Movie in a window basic setup question
CAnuszczyk Apr 21, 2011 4:06 AM (in response to onefiftymph)Sure your window is not set to Javascript instead of Lingo? - just a shot...
Otherwise, post your script
-
4. Re: Movie in a window basic setup question
onefiftymph Apr 21, 2011 5:14 PM (in response to CAnuszczyk)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


