all groups > flash actionscript > april 2005 >
You're in the

flash actionscript

group:

Changing fps.


Changing fps. iameatingjam
4/30/2005 12:00:00 AM
flash actionscript:
Re: Changing fps. kglad
4/30/2005 12:00:00 AM
no, but you can fake it. if you add the code below the dotted line to a frame
in your flash file, you can use:

mc.playF(m,n,fps); /* to play movieclip mc from frame m to frame n at fps
frames per second */

---------------------------------------------------

MovieClip.prototype.playF = function(m, n, fps) {
if (!var3141592) {
var3141592 = 0;
playA = new Array();
}
this.m = m;
this.n = n;
this.fps = fps;
this.gotoAndStop(this.m);
playA[var3141592] = setInterval(playF2, 1000/this.fps, this, var3141592);
var3141592++;
};
function playF2(mc, ind) {
if (mc.m<mc.n) {
mc.nextFrame();
} else {
mc.prevFrame();
}
if (mc._currentFrame == mc.n) {
clearInterval(playA[ind]);
}
updateAfterEvent();
}

Re: Changing fps. iameatingjam
4/30/2005 12:00:00 AM
Hmm, cant seem to get it to work for me I wanst really sure what to change. I'm
kinda a noob anway can u explain what to do with the code a little more please
:) Would the fact that I have mx not mx 2004 matter? thx
Re: Changing fps. tralfaz
4/30/2005 8:14:59 PM
[quoted text, click to view]

Here's an MX code experiment with adjustable frame rate that I did
some time ago...
http://members.cox.net/4my5cats/fps/speed.html
tralfaz

Re: Changing fps. kglad
5/1/2005 12:00:00 AM
it only matters that you publish in flash 6 (mx) or better so the setInterval()
function is defined. all you need to do is copy and paste the stuff below the
dotted line. that code must appear before the function call that uses it, so
attach it to frame 1 of the _root timeline and call the code after on frame 1
of the _root timeline or any other frame of the _root timeline or any frame of
any other timeline.

then to use you must use a movieclips instance name. for example:

_root.playF(_root.totalframes,1,12); // to play the _root timeline backwards
at 12 fps
mc1.playF(33,55,1); // to play mc1 from frame 33 to 55 at 1 fps
Re: Changing fps. iameatingjam
5/1/2005 12:00:00 AM
Originally posted by: kglad
it only matters that you publish in flash 6 (mx) or better so the
setInterval() function is defined. all you need to do is copy and paste the
stuff below the dotted line. that code must appear before the function call
that uses it, so attach it to frame 1 of the _root timeline and call the code
after on frame 1 of the _root timeline or any other frame of the _root timeline
or any frame of any other timeline.

then to use you must use a movieclips instance name. for example:

_root.playF(_root.totalframes,1,12); // to play the _root timeline backwards
at 12 fps
mc1.playF(33,55,1); // to play mc1 from frame 33 to 55 at 1 fps

Wahoo, It works! thankyou very much.

Re: Changing fps. kglad
5/1/2005 12:00:00 AM
AddThis Social Bookmark Button