Modified kirupa gavity bounce question

hello,

I have 1 ball and 2 buttons.The top button releases the ball and it hits the floor and bounces. The bottom button pulls it back up to the top again.

Currently, it snaps instantly to the top without an ease or bounce. I am trying to have that second button pull it back up and bounce off the ceiling in the same fashion as when it was dropped down but it only seems that the easing and bouncing of the ball happens on the way down.

Could any AS programmers help me out here. I’ve attached the .fla and here is my code:

ball code:

onClipEvent (enterFrame) {
	if (_root.bar1.Y == 0) {
	
	// We calculate the increase of speed
	// speedx doesn't change
	speedy = speedy+gravity;
	// We move the ball
//	this._x += speedx/5;
	this._y += speedy/5;
	if (this._y>floor) {
		this._y = floor;
		speedy *= -bounce;
		}
	}
	
	else if (_root.bar1.Y == 0) {
	// We calculate the increase of speed
	// speedx doesn't change
	speedy = speedy+gravity;
	// We move the ball
	//	this._x += speedx/5;
	this._y += speedy/5;
	if (this._y>floor) {
		this._y = floor;
		speedy *= -bounce;
		}
	}
}

1st button (drops ball)

on (press) {
	_root.bar1.Y = 0;
	_root.bar1.floor = 586;
	_root.bar1.gravity = 10;
	_root.bar1.bounce = 0.2;
	_root.bar1.speedx = 0;
	_root.bar1.speedy = 0;

}

2nd button (pulls ball up)

on (press) {
	_root.bar1.Y = 0;
	_root.bar1.floor = 14;
	_root.bar1.gravity = 10;
	_root.bar1.bounce = 0.2;
	_root.bar1.speedx = 0;
	_root.bar1.speedy = 0;

}

Thank you.