dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [EXAMPLE] Learning from Books - frameRate

  1. #1
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193

    [EXAMPLE] Learning from Books - frameRate

    Changing the frame rate is new to ActionScript 3. Here is an example.

    http://www.heritagecustomwoodworking...frameRate.html

    the movie consisits of 3 key frames with tweens set to 12.

    each button changes the frameRate to 6(slow), 24(medium), and 36(fast).

    thought I would add this

    Code:
    btnSlow.addEventListener
    	(MouseEvent.MOUSE_DOWN, slowPaceHandler);
    	
    btnMed.addEventListener
    	(MouseEvent.MOUSE_DOWN, medPaceHandler);
    	
    btnFast.addEventListener
    	(MouseEvent.MOUSE_DOWN, fastPaceHandler);
    	
    function slowPaceHandler(evt:MouseEvent):void{
    	stage.frameRate = 6;
    	}	
    
    function medPaceHandler(evt:MouseEvent):void{
    	stage.frameRate = 24;
    	}
    	
    function fastPaceHandler(evt:MouseEvent):void{
    	stage.frameRate = 36;
    	}
    Last edited by etuom; 08-07-2009 at 07:13 PM. Reason: added code

  2. #2
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    A little explanation may be helpful. frameRate comes in handy for animations in larger applications where you may wish to speed up the framerate for smoother animations at certain points and drop it to normal when you don't need it. In this regard it can help in getting good performance through the entire app.

    Slower framerates look clunky visually but perform well in regard to processing while faster framerates look good visually but can cause processing slowdowns and slow renderings which may in turn result in clunky performance.

    You might think of it as a stick shift or a throttle.

    This is all done at runtime.
    You can accomplish the same thing by adjsuting tweens at authortime.

    I just think its kind of neat.
    Last edited by etuom; 08-18-2009 at 09:51 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center