# Continuous/looping animation with AS 2.0?

**URL:** <https://forum.kirupa.com/t/continuous-looping-animation-with-as-2-0/248989>\
**Category:** Uncategorized\
**Created:** [January 14, 2008, 12:52pm UTC](https://forum.kirupa.com/t/continuous-looping-animation-with-as-2-0/248989 "2008-01-14T12:52:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crookmon](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Crookmon](https://forum.kirupa.com/u/Crookmon)\
**Post date:** [January 14, 2008, 12:52pm UTC](https://forum.kirupa.com/t/continuous-looping-animation-with-as-2-0/248989/1 "2008-01-14T12:52:16Z")

</div>

this is probably asked a zillion times but how do I script a movieclip to repeatedly fade/move/scale from x to z back to x to z again and again…

I’ve tried onEnterFrame with …if statements and whatnot but with no luck.

```auto

my_mc.onEnterFrame = function() {

if (this._alpha <= 0){
this._alpha += 5;
}
if (this._alpha >= 100){
this._alpha -=5;
}
}

```
