Search code examples
javascriptcreatejsflash-ccsoundjs

Createjs pause timeline sound in Flash CC


Is there anyway to control sound file added to timeline layer like to pause and resume the sound with timeline Or is there anyway to detect what sound is being played in the browser with creatjs

Thanks


Solution

  • Have a look at the exported lib code. There is a frame script that will have a playSound() call.

    The frame script probably looks something like this:

    this.frame_12 = function() {
        playSound("sound_id");
    }
    

    You can store off the result of this call, and control it.

    this.frame_12 = function() {
        // Store the result as part of the current object.
        this.mySound = playSound("sound_id");
    }
    

    To control it, you need to know where it resides. If it is on your main timeline, it will be part of your exportRoot:

    exportRoot.mySound.stop();
    

    I would need to know more about your setup to help more than that.