# Controlling speed of falling objects

**URL:** <https://forum.kirupa.com/t/controlling-speed-of-falling-objects/319411>\
**Category:** flash\
**Created:** [February 19, 2011, 9:39pm UTC](https://forum.kirupa.com/t/controlling-speed-of-falling-objects/319411 "2011-02-19T21:39:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmpac](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@cmpac](https://forum.kirupa.com/u/cmpac)\
**Post date:** [February 19, 2011, 9:39pm UTC](https://forum.kirupa.com/t/controlling-speed-of-falling-objects/319411/1 "2011-02-19T21:39:05Z")

</div>

I have randomly placed 40 pennies on the stage using a for loop, as well as making some of them smaller. They all start at the top of the stage and, right now, all fall down the stage at the same time.

My trouble is trying to get the larger pennies to fall faster than the smaller pennies. I’m not sure how to single them out by size to control the speed.

here is the code I have. I am only 3 weeks into ActionScript so please be specific (maybe provide an actual sample of code to use). I would really appreciate it!

```php
package com.penny {
    import flash.display.MovieClip;
    import flash.events.Event;
    
    public class Main extends MovieClip{
        private var _speedLarge = .2;

        public function Main() {
            
            
        for(var i:uint=0; i<40; i++){
            var penny:Penny = new Penny();
            addChild(penny);
            penny.x = stage.stageWidth * Math.random();
            penny.y = -700 + stage.stageHeight * Math.random();
            penny.scaleX = penny.scaleY = penny.y/600;
            penny.addEventListener(Event.ENTER_FRAME, fallingPenny);
        }
        }
        
        private function fallingPenny(evt:Event):void{
            y += _speedLarge;
            
        }
        
            
        }
        
        }

    
    

```
