i'm creating a situation on a website where if you click on a button it goes to a certain scene and plays and animation. i want to add another button that rewinds through the previous frames to create the illusion of a seamless animation (ie. instead of just jumping back from frame 51 to 41....rewind from 51 to 41 - 51,50,49,48,etc..) is there a script i can use to do this? help would be muhc appreciated!
the attached code adds a new method to movieclips, playF() that allows you to play from frame m to frame n at fps frames per second. to use on movieclip mc1: mc1.playF(m,n,fps); MovieClip.prototype.playF = function(m, n, fps) { function playF2(mc) { if (mc.m<mc.n) { mc.nextFrame(); } else { mc.prevFrame(); } if (mc._currentframe == mc.n) { clearInterval(mc.int); } updateAfterEvent(); } this.m = m; this.n = n; this.fps = fps; this.gotoAndStop(this.m); clearInterval(this.int); this.int = setInterval(playF2, 1000/this.fps, this); };
i need help with this..i'm trying to go from frame 60 - 1 in the movie clip polkemmetgallery.swf at 30 fps. is this code correct as i am having errors with it MovieClip.prototype.playF = function(60, 1, 30) { function playF2(polkemmetgallery.swf) { if (polkemmetgallery.swf.60<polkemmetgallery.swf.1) { polkemmetgallery.swf.nextFrame(); } else { polkemmetgallery.swf.prevFrame(); } if (polkemmetgallery.swf._currentframe == polkemmetgallery.swf.1) { clearInterval(polkemmetgallery.swf.int); } updateAfterEvent(); } this.60 = 60; this.1 = 1; this.30 = 30; this.gotoAndStop(this.60); clearInterval(this.int); this.int = setInterval(playF2, 1000/this.30, this); };
Hi, there's no need to change the method, leave it like it was posted by kglad. You just have to call that method with the right parameters, e.g.: on(release){ myMC.playF(60,1,30); } cheers, blemmo
don't change anything in the attached code. just copy and paste that to the first frame of your _root timeline so it's ready to use at any time. now, polkemmetgallery.swf is not a movieclip. it's a swf file. if it's loaded into a movieclip, you can reference it by using the target movieclip and you can rewind the target movieclip. but i'm not sure that's what you're doing. if you have a movieclip called polkemmetgallery that you want to rewind from 60 to 1 at 30 fps use: polkemmetgallery.playF(60,1,30);
thanks for the help guys/girls. i think i understand. i may post here again for further help if i still have probs!!
ok........ im getting all muddled up.....i've created the button i want to rewind a movie clip.....i copy and paste the code from kglad into the actions panel for the button and change only the first line of code..am i right??
the only code you need to tailor to your needs is: mc1.playF(m,n,fps);
yes, the first frame in the main or _root timeline in scene 1. (but it really doesn't matter: that attached code just needs to execute before playF() is executed so it can define the playF() method.)
thanks for all ur help & patience...this will definately save me a lot of work & time.
Don't see what you're looking for? Try a search.
|