1
    var deg2rad:Number = Math.PI/10;
var speed:Number = 3; // set to speed you want

f1.addEventListener(Event.ENTER_FRAME, moveIt);
f2.addEventListener(Event.ENTER_FRAME, moveIt);

f1.rotation = Math.random() * 0;
f2.rotation = Math.random() * 0;
var angle:Number = f1.rotation * deg2rad;


function moveIt(e:Event) {
     e.target.x -= speed*Math.cos(angle);
     e.target.y -= speed*Math.sin(angle);
}

this is my random animation script.i'm trying to create a fish tank.so what i want to do is.i want to make my fish animate non-stop (starting from right to left).

jlock
  • 69
  • 1
  • 6

1 Answers1

0

You are looking for this: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#scroll()

This is fast as nobody's business and preferred way to scroll a bitmapData.

If you want to scroll sprites or movieclips, then create two of them and scroll both, when the top-one dissapears from the stage, move it bottom and still scroll them both.

Discipol
  • 3,137
  • 4
  • 22
  • 41