You have 2 checks like
if( rope.y < 230)
and
if( rope.y > 230)
I think your animation could get stuck when y is 230 so make one of those to test for equality like
if( rope.y < =230)
or add a third case
else if(y==230)
Edit: add a new variable/field named yDirection
var yDirection:Boolean=true;
when you want to change the direction flip this flag
if( rope.y <=0)
yDirection=true;
else
yDirection=false;
if(yDirection)
rope.y=+=speed;
else
rope.y-=speed;
EDIT2 Hi had a bug in previous edit, replace the rope.y <=0 with the value you need (minY value)
EDIT3 The solutions is easy, you must check the ropeMove value,
if(ropeMove){
if( rope.y <=0)
yDirection=true;
else
yDirection=false;
if(yDirection)
rope.y=+=speed;
else
rope.y-=speed;
}
Your questions are very basic so you should learn the basics of algorithms,