Hi,

I'm making a very easy bouncing game. The score and that kind of stuff are coming later but first of al I want to make a good bounce.

This is my code so far:

Actionscript Code:
package {
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.geom.ColorTransform;
    import flash.geom.Rectangle;
    public class Ball extends MovieClip {
       
public var speedX:int=25;
public var speedY:int=20;
    public function Ball( ) {
    addEventListener(Event.ENTER_FRAME, onEnterFrame);
        var colorTransform:ColorTransform = new ColorTransform( );
    colorTransform.color=Math.random( )*0xFFFFFF;
    transform.colorTransform = colorTransform;
    }
private function onEnterFrame(event:Event):void {
        x +=speedX;
        y +=speedY;
        var bounds:Rectangle=getBounds(parent);
            if (bounds.left <5 || bounds.right> stage.stageWidth) {
         speedX*=-1;
    }
    if (bounds.top <10 || bounds.bottom > stage.stageHeight) {
    speedY*=-1;
          }  
        }
      }
    }

Its bouncing against the stage edges and random putting a different direction. But I want to float the ball around and that he is shooting some way randomly. Sorry for the bad english but this is what I mean:

http://www.bezzmedia.com/swfspot/sam...h_Smoke_Effect

But this is AS 2.0 can somebody help me get it working in my AS3 code?

Tnx

Geert