【问题标题】:"Undefined is not a function" playing sound in Dashcode“未定义不是函数”在 Dashcode 中播放声音
【发布时间】:2012-01-26 12:23:29
【问题描述】:

我正在尝试在 Dashcode 小部件中播放声音。我只是将文件放在小部件上,现在我是一个视频项目。

这是我正在使用的代码:

// Values you provide
var qtElement = document.getElementById("video"); // replace with the ID of a QuickTime element
// QuickTime code
qtElement.Play();

当它到达最后一行时,我收到了这个错误:

"Undefined is not a function"

【问题讨论】:

标签: macos audio widget dashcode


【解决方案1】:

我刚刚通过使用解决了我自己的小部件上的问题

var qtElement = document.getElementById('AlainVoice');
// QuickTime code
qtElement.children[0].play();

重要的部分是 children[0],因为 Dashcode 现在将 Id 放在封闭的 div 上。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-24
    • 2016-10-28
    • 2016-12-23
    • 1970-01-01
    相关资源
    最近更新 更多