# Can someone please explain this better?

**URL:** <https://forum.kirupa.com/t/can-someone-please-explain-this-better/5990>\
**Category:** Uncategorized\
**Created:** [September 27, 2002, 3:25am UTC](https://forum.kirupa.com/t/can-someone-please-explain-this-better/5990 "2002-09-27T03:25:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2002, 3:25am UTC](https://forum.kirupa.com/t/can-someone-please-explain-this-better/5990/1 "2002-09-27T03:25:25Z")

</div>

hi,  
i read this tutorial on dynamic event handlers on this site

i am still LOST as to how they work  
if someone can explain this better to me (if thats possible)  
i would really appreciate it

so go here and click on the dynamic event handler tute  
[http://www.kirupa.com/developer/actionscript/as\_tricks.asp](http://www.kirupa.com/developer/actionscript/as_tricks.asp)

things like :

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

make my head hurt - i WANT to understand this please help!!

thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2002, 3:52am UTC](https://forum.kirupa.com/t/can-someone-please-explain-this-better/5990/2 "2002-09-27T03:52:36Z")

</div>

From what I could understand:

```auto

onClipEvent (enterFrame){ // Every time flash starts a new frame
if (this._x<30) { // Check if the _x position of this is less than 30
 this._x+=5; // and if it is move the x position 5 more to the right
}
}

```

this.\_x += 5 is the same as saying

this.\_x = this.\_x + 5.

Flash enters a new frame depending on the frames per second you have set.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2002, 10:07am UTC](https://forum.kirupa.com/t/can-someone-please-explain-this-better/5990/3 "2002-09-27T10:07:42Z")

</div>

> \*Originally posted by pixel\_fiend \*  
> **if someone can explain this better to me (if thats possible)  
> i would really appreciate it**  
> Are you trying to say that I wasn’t clear?

No seriously, I tried to make it step by step. The only thing that is tricky here is the += thing, and I explained it in another AS trick… Unfortunately the order of the articles is not correct. Sorry about that.

pom 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 27, 2002, 11:33am UTC](https://forum.kirupa.com/t/can-someone-please-explain-this-better/5990/4 "2002-09-27T11:33:01Z")

</div>

Actually it’s not more than a week ago i figured out += and -= and so on…

It does actually save code + time…

p-fiend: Just fiddle around with it for a few days, it sinks in pretty quickly 😛
