// Created by Andrew Odendaal
//
// :: DESCRIPTION ::
// Animate a ball moving to the top
// of the screen/stage and back again
//
// :: HOW TO USE ::
// create a circle shape, convert to a movieclip(mc) and
// place the registration point at the bottom center.
// give the circle mc an stage instance name of 'ball'.
var ball:MovieClip;
var initBallY:Number = _root.ball._y;
onEnterFrame = function() {
if (_root.ball._y < 2.31) {
_root.ball._y = initBallY;
} else {
_root.ball._y=_root.ball._y-10;
}
}
Animate with Actionscript [part1]

Andrew
Andrew is a visionary software engineer and DevOps expert with a proven track record of delivering cutting-edge solutions that drive innovation at Ataiva.com. As a leader on numerous high-profile projects, Andrew brings his exceptional technical expertise and collaborative leadership skills to the table, fostering a culture of agility and excellence within the team. With a passion for architecting scalable systems, automating workflows, and empowering teams, Andrew is a sought-after authority in the field of software development and DevOps.
Related Articles
How to load xml into flash using actionscript 2
Oct 20, 2009 • 0 min read
How to load xml into flash using actionscript 2
Actionscript 3 equivalent of PHP’s print_r
Oct 20, 2009 • 0 min read
Actionscript 3 equivalent of PHP’s print_r
Global variables and functions in Actionscript 2
Oct 20, 2009 • 0 min read
Global variables and functions in Actionscript 2
Tags
Recent Posts
Macros in Rust: Metaprogramming Made Simple
Apr 5, 2025Concurrency in Rust: Fearless Parallelism
Mar 22, 2025Lifetimes in Rust: Managing References Safely
Mar 15, 2025