# Changing 1.0 script to 3.0

**URL:** <https://forum.kirupa.com/t/changing-1-0-script-to-3-0/250932>\
**Category:** flash\
**Created:** [February 3, 2008, 6:21pm UTC](https://forum.kirupa.com/t/changing-1-0-script-to-3-0/250932 "2008-02-03T18:21:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dporvin](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dporvin](https://forum.kirupa.com/u/dporvin)\
**Post date:** [February 3, 2008, 6:21pm UTC](https://forum.kirupa.com/t/changing-1-0-script-to-3-0/250932/1 "2008-02-03T18:21:28Z")

</div>

Hello. I’m just learning Flash CS3 & Action Script and I found an example of a “screen saver” type script at…

> **[Moving Objects bounce when hitting Edge](https://www.kirupa.com/forum/showthread.php?t=207565)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

The code is…

vel\_x = 10;  
vel\_y = 10;  
onEnterFrame = function () { ball.\_y += vel\_y;ball.\_x += vel\_x;if (ball.hitTest(left) || ball.hitTest(right)) {vel\_x = -vel\_x;}if (ball.hitTest(top) || ball.hitTest(down)) {vel\_y = -vel\_y;}};

It was just what I was looking for! The ball.fla still works if I change the settings to 2.0, but gives errors in 3.0. What changes would be necessary for 3.0?  
Thanks and Take Care,  
-DP
