首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AS3声音,向前跳跃?

AS3声音,向前跳跃?
EN

Stack Overflow用户
提问于 2011-10-20 17:37:27
回答 1查看 632关注 0票数 0

我正在用as3播放循环声音,有没有办法跳到声音的特定部分,比如当用户按下btn时,在播放过程中跳到20秒内?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-10-20 18:44:04

假设您已经创建了Sound和SoundChannel对象。

代码语言:javascript
复制
private var mySound:Sound;
private var mySoundChannel:SoundChannel;

function onButtonClick(e:MouseEvent):void {
    var pos:Number = 0;
    if ( mySoundChannel ) {
        pos = mySoundChannel.position;
        mySoundChannel.stop();
    }
    //jump ahead 20 seconds, the play accepts time in ms
    mySoundChannel = mySound.play(pos + (20 * 1000));
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7833935

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档