"Undefined is not a function" playing sound in Dashcode

370 views Asked by At

I'm trying to play a sound in a Dashcode widget. I just droped the file over the widget and now I a video item.

This is the code I'm using:

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

When it gets to the final line I got this error:

"Undefined is not a function"
1

There are 1 answers

0
Kheldar On

I just solved the issue on my own widget via using

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

The important part is the children[0] since Dashcode now puts the Id on an enclosing div.