Groups | Blog | Home
all groups > flash actionscript > may 2005 >

flash actionscript : Dynamic Framerate



MaxVT103
5/26/2005 12:00:00 AM
MaxVT103
5/26/2005 12:00:00 AM
setInterval() is just a timer in milliseconds before it calls something, I am
looking for a way of actually changing the whole movies framerate, the
framerate you set in the movies properties when you are creating it.
LuigiL
5/26/2005 12:00:00 AM
[quoted text, click to view]
Rothrock
5/26/2005 12:00:00 AM
LuigiL
5/26/2005 12:00:00 AM
Use setInterval();
kglad
5/26/2005 12:00:00 AM
yep, here it is again. the code below the dotted line adds another method to
the movieclip class. you can play any movieclip at any frame rate (that the
host computer can handle) in any direction:

to use, specify the movieclip, frame rate and frames to play - forward or
backward, doesn't matter:

yourMC.playF(1,yourMC._totalframe,33);
------------------------------------------------------------------
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();
}

LuigiL
5/26/2005 12:00:00 AM
MaxVT103
5/26/2005 12:00:00 AM
kglad
5/26/2005 12:00:00 AM
jrk
10/21/2005 9:12:22 PM
kglad
10/21/2005 11:53:11 PM
kglad
10/22/2005 12:00:00 AM
if all movieclips in your swf are playing and they don't loop you can use:

yourBtn.onPress=function(){
fpsControlF(_root,1);
}
yourBtn.onRelease=function(){
fpsControlF(_root,12); // <- use your "original" frame rate here instead of 12
}
function fpsControlF(mc,fps){
for(obj in mc){
if(typeof(mc[obj])=="movieclip"&&mc[obj]._name==obj){
mc[obj].playF(mc[obj]._currentframe,mc[obj]._totalframes,fps);
fpsControlF(mc[obj],fps);
}
}
}

jrk
10/22/2005 12:49:41 AM
kGlad to hear. Thanks. I can't figure out what m and n are (I guess fps =
frames per second).

I want to make a transparent button over nested MC animation which, when
pressed, slows the frame rate of everything to around 1 fps, and then, when
released, returns all to the original speed.
jrk
10/23/2005 12:00:00 AM
I don't know how to use this code.
jrk
10/27/2005 12:00:00 AM
kglad
10/27/2005 12:00:00 AM
no, not through email. i have too many people that keep sending me things once
i've given them my email address.

you can upload your fla on a server. if you don't have a server now, you can
obtain space on a free one like geocities.
kglad
10/27/2005 6:43:41 AM
jrk
10/27/2005 7:55:13 PM
I just created a site at Geocities and have uploaded the file there.
ID: jamtester
password: GIaKUn
NSurveyor
10/27/2005 9:01:05 PM
LoL. :D You didn't have to tell the whole world your username and password. You
just had to post the url of the file:
http://www.geocities.com/jamtester/DNAreplicREVIZc.fla

I suggest you change your password if you ever want to use that account again.
jrk
10/27/2005 9:51:30 PM
jrk
10/27/2005 9:56:33 PM
kglad: the file is at
kglad
11/2/2005 7:42:57 PM
yes, the code below the dotted line must execute before the playF() method is
used. in addition, the playF() method assumes the movieclip to which it is
applied does not loop and that appears to NOT be the case in your project. it
appears that all the movieclips, to which that code would apply, loop. is that
true?
jrk
11/2/2005 7:54:17 PM
That does it. My movie has to be adjusted a lot but I think I know how.
kglad
11/2/2005 7:59:42 PM
AddThis Social Bookmark Button