我创建循环视频。
我想将函数回调用于另一个堆栈。
这是我的代码:
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
答案 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
消息。