Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-14-2007, 05:45 PM   #1
orange gold
got as?
 
Join Date: May 2007
Posts: 628
Default frames per second help

is there any way that i can have it so i click a button and the frames per seconds changes to 80 or sumthing, thanks i need it immeaditly so please help
orange gold is offline   Reply With Quote
Old 12-14-2007, 06:04 PM   #2
ssrun
Registered User
 
Join Date: Dec 2007
Posts: 12
Default

I'm not aware that you can change the framerate while the program is running. If you really need to code running at variables speeds, look into using setInterval().
ssrun is offline   Reply With Quote
Old 12-14-2007, 06:14 PM   #3
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

in increasing your fps .. are you trying to make the animation run faster ?? or make code execute faster?
__________________
Always optimizing...
xxneon is offline   Reply With Quote
Old 12-14-2007, 07:44 PM   #4
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

http://proto.layer51.com/d.aspx?f=832
atomic is offline   Reply With Quote
Old 12-14-2007, 08:14 PM   #5
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

in that prototype i dont think it changes the refresh speed though.. what do you think atomic??

but since the prototype is focused around setInterval i think if you stick the updateAfterEvent() in there .. that would cause it to refresh the screen on every interval... basically making it be its own FPS .. ?? am i correct.. i dont see that being used in that code though..
__________________
Always optimizing...
xxneon is offline   Reply With Quote
Old 12-14-2007, 08:30 PM   #6
atomic
Banned by AS.org Staff
 
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
Default

A simple and old way of doing it, is simply to load a "stream" silent sound .swf at the desired framerate... The player will then be forced to try and maintain that framerate... Although 80fps is a ridiculously high framerate, that certainely won't be maintained if this is online...
atomic is offline   Reply With Quote
Old 12-14-2007, 10:12 PM   #7
asf8
Senior Member
 
Join Date: Apr 2007
Posts: 4,772
Default Here is another one...

Quote:
Originally Posted by atomic View Post
Cool find atomic, never seen that one. I am gonna try it.

Here is another one I found that seems really nice, I setup some sample code for demonstration:
http://weblog.motion-graphics.org/ar...c_frame_r.html

ActionScript Code:
// Dynamic FrameRate Prototype // [url]http://weblog.motion-graphics.org/archives/2006/01/dynamic_frame_r.html[/url] // function setFrameRate(frameRate:Number):Void {     var timelineFaster:Function = function () {         me.nextFrame();         updateAfterEvent();     };     var me:MovieClip = this;     clearInterval(me.tweenFaster);     me.tweenFaster = setInterval(timelineFaster, frameRate); } MovieClip.prototype.setFrameRate = setFrameRate; MovieClip.prototype.tweenFaster = new Number(); // // Three movieclips on stage with instance names of // ball1_mc, ball2_mc, ball3_mc, I just used the same // movieclip with a 40 frame motion tween and this on // the last frame in a code layer -- this.gotoAndPlay(1); // for testng purposes. // ball1_mc.setFrameRate(1); // ball1 Fast ball2_mc.setFrameRate(200); // ball2 Slow // ball3_mc is using your standard timeline framerate // // 4 movieclips used as buttons for slowing down // and speeding up. // b1slow_mc.onRelease = function (){ // ball1_mc Slow     ball1_mc.setFrameRate(100); } b1fast_mc.onRelease = function (){ // ball1_mc Fast     ball1_mc.setFrameRate(1); } b2slow_mc.onRelease = function (){ // ball2_mc Slow     ball2_mc.setFrameRate(200); } b2fast_mc.onRelease = function (){ // ball2_mc Fast     ball2_mc.setFrameRate(10); } /* You can also use it on a MovieClips timline to alter the speed during the duration of your animations etc... Here is a sample of doing just that, create a 120 frame animation of something and make a code layer with tthe following 4 scripts and then test the movie. Frame 1 AS Layer Code this.setFrameRate(1); // crazy fast Frame 40 AS Layer Code this.setFrameRate(40); // slower Frame 80 AS Layer Code this.setFrameRate(200); // very slowwwwwwwwwer Frame 120 AS Layer Code stop(); // the end - so stop // or // this.gotoAndPlay(1); // to loop the animation again */
asf8 is offline   Reply With Quote
Old 12-15-2007, 02:34 AM   #8
orange gold
got as?
 
Join Date: May 2007
Posts: 628
Default

i have alinerider uncoded andi while im plasying the video i want a button soi can press it and he will go faster
orange gold is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I Scale Frames on the Timeline? brianemsu Flash 9 General Questions 1 12-02-2007 06:30 AM
jumping to different frames bobbyopulent ActionScript 2.0 2 09-03-2006 10:16 PM
Copy and past frames annasweb Other Flash General Questions 1 02-20-2006 05:26 PM
Newbie - moving a specified # of frames ahead of current frame chard ActionScript 2.0 13 05-19-2005 07:27 AM
Targeting Specific Frames and Creating new frames BrokenHope ActionScript 2.0 14 12-08-2004 04:36 PM


All times are GMT. The time now is 07:15 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.