I've been using the Director article
Flash to Control DVD Movies" to create a browser-based DVD
player for a TV DVD and have come across some problems creating
dynamic clips. The article has a "clip" button that plays one clip
by defining a start time array and an end time array and using
localConnection to call Director to play that clip from start to
end. I can get a clip to play if it's on title 1, but once it's on
a different title, it doesn't play the clip, even though I specify
which title to go to.
The original clip button code, with my minor modification,
looks like this (I'll call it CLIP 1):
var ti = _parent.testGetProperty("title");
var tStart = Array("title", ti, "hours", 0, "minutes", 0,
"seconds", 10, "frames", 1);
var tStop = Array("title", ti, "hours", 0, "minutes", 0,
"seconds", 17, "frames", 1);
var tSuccess = _parent.testCallMethod("play", tStart,
It used to have a 1 for title, but I changed it to go to the
current title. It works both ways in title 1.
My second clip code, for a clip in title 2, looks like this
When I'm in title 2, it tries to go to the right place, but
then ends up going to title 1 and playing CLIP 1. When I click on
CLIP 2 while in title 1, it does nothing. (CLIP 2 behaves the same
whether I use a constant or current title like above.) Any
suggestions? In another iteration I was able to play 3 clips all
within title 1. Is there any way to get to those other titles?
I'm assuming that this is the code that is called in
on lc_dvdCallMethod(me, xFlashObj, xSender, xReplyMethod,
xMethodToCall, xParameter1, xParameter2, xParameter3)
-- Receive a request (through localConnect) to call a
function on the DVD member.
if not (pUseLocalConnect) then EXIT
if voidP(pLocalConnect_fromDvd) then EXIT
tMember = pSprite.member
tCall = "tMember." & xMethodToCall & "("
repeat with tParamNum = 1 to 3
tParam = VOID
do("tParam = xParameter" & tParamNum)
if not voidP(tParam) then
-- Convert any arrays to prop lists.
if (tParam.ilk = #flashObjectArray) then
do("xParameter" & tParamNum & " =
me.flashArrayToPropList(xParameter" & tParamNum & ")")
-- Add the parameter to the call.
tCall = tCall & "xParameter" & tParamNum & ","
-- Delete last comma.
if tCall.char[tCall.length] = "," then
tResult = VOID
tCall = "tResult = " & tCall & ")"
case tResult.ilk of
tResult = string(tResult)
tResult = "void"
pLocalConnect_fromDvd.send(xSender, xReplyMethod, tResult)
And of course I already have something to add. I had a start
time in CLIP 2 that was past the duration of title 2, so when I
fixed it I was able to play CLIP 2 while in title 2. It's still not
accessible from another title.