package {
import flash.display.Sprite;
import flash.events.Event;
public class bar extends Sprite {
private var _delta:Number;
public function get delta():Number {return _delta; }
public function set delta(value:Number):void { _delta = value; }
public function bar() {
this.graphics.beginFill(0x0000f, 100);
this.graphics.drawCircle(0, 0, 5);
this.graphics.endFill();
this.x = 50;
this.y = 100;
delta = 1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
/**
* Called by the Flash player on each successive
* frame.
*
* Notice that onEnterFrame() does not actually draw
* anything. It just alters the state of the thing
* to be drawn (that is, of this' x position).
*/
public function onEnterFrame(event:Event):void {
this.x += delta;
}
} }