# Simple Actionscripting Help/Problem

**URL:** <https://forum.kirupa.com/t/simple-actionscripting-help-problem/184031>\
**Category:** flash\
**Created:** [April 1, 2006, 6:59am UTC](https://forum.kirupa.com/t/simple-actionscripting-help-problem/184031 "2006-04-01T06:59:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flaevo](https://avatars.discourse-cdn.com/v4/letter/f/bbce88/32.png) [@Flaevo](https://forum.kirupa.com/u/Flaevo)\
**Post date:** [April 1, 2006, 6:59am UTC](https://forum.kirupa.com/t/simple-actionscripting-help-problem/184031/1 "2006-04-01T06:59:20Z")

</div>

I’m trying to call a function that will slowly move/fade an object and it doesn’t seem to want to work.

Here is the code can someone possibly tell me what I’m doing wrong sorry im sort of new but im fluent in php soo I can’t get this 😛

```auto
mypos = 1;
position = function () {
    mypos++;
    setProperty(this.mybox, _alpha, mypos);
}
setInterval(position, 1000);

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [April 1, 2006, 7:32am UTC](https://forum.kirupa.com/t/simple-actionscripting-help-problem/184031/2 "2006-04-01T07:32:09Z")

</div>

> [@xfuzion](#):
>
> I’m trying to call a function that will slowly move/fade an object and it doesn’t seem to want to work.
> 
> Here is the code can someone possibly tell me what I’m doing wrong sorry im sort of new but im fluent in php soo I can’t get this 😛
> 
> ```auto
> mypos = 1;
> position = function () {
> mypos++;
> setProperty(this.mybox, _alpha, mypos);
> }
> setInterval(position, 1000);
> 
> ```
> 
> Thanks in advance!

maybe something like this

```auto
mypos = 1;
mybox._alpha = 0;
position = function () {
	mybox._alpha++;
	mybox._x += mypos;
	if (mybox._alpha>=100 && mybox._x>100) {
		mybox._alpha = 100;
		mybox._x = 50;
		clearInterval(mi);
	}
};
mi = setInterval(position, 100);

```

---

<div class="post-metadata">

**Author:** ![Flaevo](https://avatars.discourse-cdn.com/v4/letter/f/bbce88/32.png) [@Flaevo](https://forum.kirupa.com/u/Flaevo)\
**Post date:** [April 1, 2006, 7:37am UTC](https://forum.kirupa.com/t/simple-actionscripting-help-problem/184031/3 "2006-04-01T07:37:03Z")

</div>

Thank you a ton 🙂 I think it had to do with the clear interval and the loop… I shoulda known better this will allow me to do everything I’ve been needin to do

Thanks a ton!!!
