Results 1 to 3 of 3

Thread: Playing a sound in the middle of the scene

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
      0  

    Question Playing a sound in the middle of the scene

    Is it possible to play a sound in the middle of the scene without any user activity? I played around with jQuery delay() without any success.

    In Flash you can just add a keyframe and some keyframe based actions to do this. Is this possible in Sencha Animator?

    If I add an invisible object, say transparent png image, so is there a load event where I could add js to play a sound?

    Cheers!

  2. #2
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
      0  

    Default

    Currently there is no way to tie JS to a keyframe in Animator.

    One advanced way of accomplishing it, would be to add an hidden animation, with two keyframes, and listen for the 'animationEnd' event fired by the object when the animation is done and use that to fire your event.

    A simpler approach would be to add a timeout to your Start Action of the scene. For example:

    Code:
    //get stage of first scene
    var stageElement = document.querySelector('.AN-sObj-stage')
    
    
    //create timeout at 1000ms (1 second)
    setTimeout(function(){
        //change the background color of the stage to red
        stageElement.style.backgroundColor = "red";
    },1000)
    Attached Files Attached Files

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Ok, thank you very much for the help. I think I'll use setTimeout for this.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •