# Motion with Actionscript

**URL:** <https://forum.kirupa.com/t/motion-with-actionscript/154521>\
**Category:** flash\
**Created:** [July 10, 2005, 7:46pm UTC](https://forum.kirupa.com/t/motion-with-actionscript/154521 "2005-07-10T19:46:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToXic](https://avatars.discourse-cdn.com/v4/letter/t/13edae/32.png) [@ToXic](https://forum.kirupa.com/u/ToXic)\
**Post date:** [July 10, 2005, 7:46pm UTC](https://forum.kirupa.com/t/motion-with-actionscript/154521/1 "2005-07-10T19:46:57Z")

</div>

Hi, I am pretty new to AC, I just happened to open up Flash a few days ago and searched for AC and loved how it works but I am having some trouble with it. I’m gonna try to start at the basic animations, last night I tried to make a bouncing ball that went from Y:50 - X:50 all the way down to the screen and when it reaches Y:350 (I was using the ruler & grid lol) I wanted it to make it bounce back up slowy at the same speed.  
For this then I used:

on (load) {  
this.\_x = 50;  
this.\_y = 50;  
}

onClipEvent (enterFrame) {  
if (this.\_y\<300) {  
this.\_y += 10;  
this.\_x +=5;  
}

This worked, but the ball only went down as I have no clue how code it to make it bounce back! I tried another following IF statement but it didn’t work. Appreciate any help thanks alot!
