【问题标题】:How to callbacks to another stack ? - Livecode如何回调到另一个堆栈? - 实时代码
【发布时间】:2014-05-08 09:49:56
【问题描述】:

我创建循环视频。

我想使用函数回调到另一个堆栈。

这是我的代码:

   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

【问题讨论】:

  • 请写下如果你运行这段代码会发生什么。

标签: livecode


【解决方案1】:

如果您想在电影播放完毕后执行脚本,则无需使用回调。您可以使用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 消息。

【讨论】:

    猜你喜欢
    • 2019-08-08
    • 2022-10-17
    • 1970-01-01
    • 2019-10-08
    • 2020-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    相关资源
    最近更新 更多