主题:  有关帧速的控制

civ3

职务:普通成员
等级:1
金币:0.0
发贴:45
#12003/1/19 18:56:26
谁会用AS控制影片的帧速?
独立播放器兼容这种调节吗?
有演示的成品吗?



janlay

职务:管理员
等级:7
金币:28.0
发贴:7244
#22003/1/19 19:33:33
发帖前可以搜索一下论坛的旧帖:)

www.5dmedia.com/bbs/newsdetail.asp?id=229544



s22

职务:版主
等级:4
金币:10.0
发贴:1634
#32003/1/20 12:34:29

// DoubleYou
// [flashAPI].mx timer
//
// it's part of [flashAPI] project
// www.doubleyou.com/flashAPI
//
// [02.03.08] nacho@doubleyou.com

/*
    constructor :
        theTimer = new Timer(miliseconds);
        -> miliseconds : miliseconds to launch onTimer event

    methods :
        start()
        -> start the timer
        
        stop()
        -> stop the timer
        
        reset()
        -> reset the timer to 0
            
    properties :
        interval
        -> miliseconds to launch onTimer event
            
    events :
        onTimer()
        -> events launch in each interval
        
        onStart()
        -> events lauch at start time
        
        onStop()
        -> events launch at stop time
            
    example :
        var theTimer = new Timer(1000);
        theTimer.onTimer = function()
        {
            trace("another second left of your life...");
        }
        theTimer.start();
    
*/

Timer = function(miliseconds)
{
    // length of this timer
    this.interval = miliseconds;
}

Timer.prototype.start = function()
{
    // reset the timer
    this.reset();
}

Timer.prototype.reset = function()
{
    // reset the time from which this counts
    if (this.ID) clearInterval(this.ID);
    this.ID = setInterval(this,"onTimer",this.interval);
}

Timer.prototype.stop = function()
{
    clearInterval(this.ID);
    this.onStop();
}



=======

下面的1000代表每1000毫秒就执行一次,也就是说你可以调节速度
很方便
var theTimer = new Timer(1000);
theTimer.onTimer = function(){
path.mc.nextframe();
    }
theTimer.start();