# Confused with actionscript

**URL:** <https://forum.kirupa.com/t/confused-with-actionscript/29636>\
**Category:** Uncategorized\
**Created:** [August 28, 2003, 10:52pm UTC](https://forum.kirupa.com/t/confused-with-actionscript/29636 "2003-08-28T22:52:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dessoya](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@dessoya](https://forum.kirupa.com/u/dessoya)\
**Post date:** [August 28, 2003, 10:52pm UTC](https://forum.kirupa.com/t/confused-with-actionscript/29636/1 "2003-08-28T22:52:24Z")

</div>

hi there,

i got this as from [kirupa.com](http://kirupa.com) tutorials and im frustrated…  
i like to know why the object is moving slowly to its targetposition (like tweening)

[AS]setProperty(this, \_x, cX-(difX/30)); [/AS]

if i would put in this code:

[AS]setProperty(this, \_x, difX); [/AS]

it wont fade to its target position smoothly…

so, what is the main thing about these 2 scripts!?

thanx in advance

d

---

<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:** [August 28, 2003, 10:59pm UTC](https://forum.kirupa.com/t/confused-with-actionscript/29636/2 "2003-08-28T22:59:49Z")

</div>

the calculation puts a decrement value between the first and last positions …  
“get there gradually according to this math”

instead of just two different positions

---

<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:** [August 28, 2003, 11:03pm UTC](https://forum.kirupa.com/t/confused-with-actionscript/29636/3 "2003-08-28T23:03:42Z")

</div>

so i see,

therefore i have to store the current x-position after or before the “setProperty” command right?

like this:  
[AS]  
onClipEvent(enterFrame) {  
this.\_x = cx;  
setProperty(this, \_x, cX-(difX/30));  
}  
[/AS]

without that it would not achieve that desired effect right?

sorry for this maybe dumb question but i am new and try to learn as much as i can 😉

d
