1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    35
    Vote Rating
    0
    I3D is on a distinguished road

      0  

    Default "'undefined' is not a function" error.

    "'undefined' is not a function" error.


    Hey Guys

    I'm running into a serious error that I can't seem to resolve for some time now. basically I'm starting an audio file to play at the start of the scene, and I'm monitoring to see if the audio file has ended then i'll go to another scene, problem is whenever i do that, i get "'undefined' is not a function" error.

    Code:
    varSceneSound=new buzz.sound(".../something.m4a");
    SceneSound.play();
    SceneSound.addEventListener('ended', checkEnding,false);
    function checkEnding(){
    
    console.log("TEST");
    controller.goToNextScene();
    }
    and if i try to query the object i got a null error, guessing the query object is empty.

    Code:
    varSceneSound=new buzz.sound(".../something.m4a");
    SceneSound.play();
    var objAudio = document.querySelector("#SceneSound audio");
    SceneSound.addEventListener('ended', checkEnding,false);
    
    function checkEnding(){
    
    console.log("TEST");
    controller.goToNextScene();
    }
    any thoughts?

    Thanks

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    35
    Vote Rating
    0
    I3D is on a distinguished road

      0  

    Default


    ok I was able to minimise the error to the following:

    Code:
    var element = new buzz.sound("http://.../temp.m4a");
    
    element.play();
    
    
    function checkEnding() {
        controller.goToNextScene();
    }
    
    
    element.addEventListener("ended", checkEnding, false);
    when i do that, the play function does the trick and plays the audio, how ever adding an event still gives an undefined error! any ideas?

    Thanks

  3. #3
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
    arnebech will become famous soon enough

      0  

    Default


    You're getting a Buzz object back, not a regular DOM element probably.

    The buzz documentation talks about how to bind/listen on their objects in their documentation.
    http://buzz.jaysalvat.com/documentation/sound/#events

    So you probably need something like
    Code:
    var sound = new buzz.sound(...)
    sound.bind('ended', yourFunctionCallback);

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."