1 Reply Latest reply on Dec 11, 2006 9:35 AM by ilovetaron

    DVD controlling - Clip creation in multiple titles

      I've been using the Director article "Using 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, tStop);

      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 (CLIP 2):

      var tStart = Array("title", 2, "hours", 0, "minutes", 5, "seconds", 42, "frames", 1);
      var tStop = Array("title", 2, "hours", 0, "minutes", 5, "seconds", 51, "frames", 1);
      var tSuccess = _parent.testCallMethod("play", tStart, tStop);

      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 Director:

      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 & ")")
      end if
      -- Add the parameter to the call.
      tCall = tCall & "xParameter" & tParamNum & ","
      end if
      end repeat
      -- Delete last comma.
      if tCall.char[tCall.length] = "," then
      delete tCall.char[tCall.length]
      end if
      tResult = VOID
      tCall = "tResult = " & tCall & ")"
      case tResult.ilk of
      tResult = string(tResult)
      tResult = "void"
      end case
      pLocalConnect_fromDvd.send(xSender, xReplyMethod, tResult)

      end lc_dvdCallMethod