如何回调到另一个堆栈? - 动态代码

时间:2014-05-08 09:49:56

标签: livecode

我创建循环视频。

我想将函数回调用于另一个堆栈。

这是我的代码:

   start using stack "Widget Project"
   put the duration of player "Player" into tDuration
   put tDuration & ",restartPlayer" into tCall
   set the callbacks of player "Player" to tCall

1 个答案:

答案 0 :(得分:0)

如果要在电影结束播放时执行脚本,则不需要使用回调。您可以使用playStopped消息:

on beforeYouStartPlayingTheMovie
   start using stack "Widget Project"
end beforeYouStartPlayingTheMovie

-- in stack "Widget Project"
on playStopped
  if the id of the target is the id of player "Player" of stack "Your Stack" then
    -- do whatever you want here
  end if
  pass playStopped
end playStopped

在iOS和Android上使用playerFinished消息。