I can't for the life of me, figure out how to make a very simple animation smooth in Flash. I have very little experience with Actionscript.
I have a solid colored circle and want to have it move it across the screen (1280 x 720) smoothly. I've tried a variety of frame rates and export formats (the ones that don't error).
I'm using a very old version of Flash (v8, Actionscript 2) but it should but it should still work smoothly. I can't afford new version of Flash.
HP Laptop: Pavilion DM3
AMD Athlon Neo X2 Dual core Processor L335, 1.6 GHZ
4 gig ram, 500gb HDD
ATI Radeon HD 3200 graphics chip.
Windows 7 home premium (64 bit)
I found this tutorial, but Flash AS2 said it needed to appear inside onClipEvent. So I did that but it's still choppy. I also tried changing the setInterval value to 5ms and the x increment to 1.
http://www.flashvalley.com/fv_tutorials/updateAfterEvent/page2.php
onClipEvent (load) {
// The function moveSphere is going to be called every 10ms
setInterval(moveSphere, 10);
// this is our main function that will animate the ball
function moveSphere() {
if (greenSphere._x>220) {
sphereDirection = "left";
}
if (greenSphere._x<5) {
sphereDirection = "right";
}
if (sphereDirection == "right") {
greenSphere._x += 2;
} else {
greenSphere._x -= 2;
}
// here we refresh the screen each time the function is called, in our case every 10ms
updateAfterEvent();
}
}