# AS'd movement, and repeat

**URL:** <https://forum.kirupa.com/t/asd-movement-and-repeat/13194>\
**Category:** Uncategorized\
**Created:** [February 10, 2003, 5:07am UTC](https://forum.kirupa.com/t/asd-movement-and-repeat/13194 "2003-02-10T05:07:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![korrupt](https://avatars.discourse-cdn.com/v4/letter/k/e56c9b/32.png) [@korrupt](https://forum.kirupa.com/u/korrupt)\
**Post date:** [February 10, 2003, 5:07am UTC](https://forum.kirupa.com/t/asd-movement-and-repeat/13194/1 "2003-02-10T05:07:01Z")

</div>

Okay, here’s the deal…

I worked on Kirupa’s tut on how to make the action scripted movement, and it working well, until I wanted it to reappear and repeat…

I’m working on a Stick Shooting game (the basic first draft can be seen at [http://www.stickslaughter.com/stickshooter.html](http://www.stickslaughter.com/stickshooter.html)) and have been attempting to make a stick, walk from one side of the stage to the other, and repeat. I can do that easily, but then i run into a problem…

When you shoot the stick, it goes into an animation where it dies and fades to 0 alpha. So when the stick reappears, he’s invisible, therefore making it pointless for him to repeat. Here’s the script I have on the stick right now:

```auto

onClipEvent (enterFrame) {
	speed = 5;
	this._x += speed;
	if (this._x>=500) {
		this._x = 20;
		tellTarget (_root.target) {
		gotoAndPlay(1)
	}
}
}

```

So he moves until 500 on the stage, then repeats, and the tellTarget attempts to make the stick (instance name: target) go back to frame 1, where’s he walking visibly.

Any suggestions?  
Thanks in advance…  
KoRRupt

---

<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:** [February 10, 2003, 5:13am UTC](https://forum.kirupa.com/t/asd-movement-and-repeat/13194/2 "2003-02-10T05:13:51Z")

</div>

tellTarget is deprecated. And why are you targeting \_root.target? Isn’t your animation in the same clip that the actions are on? If that is so, shouldn’t it be

```php
onClipEvent (enterFrame) {
	speed = 5;
	this._x += speed;
	if (this._x>=500) {
		this._x = 20;
		this.gotoAndPlay(1);
	}
}

```

(this.gotoAndPlay or \_root.yourClip.gotoAndPlay(), etc are replacements for the deprecated tellTarget)

---

<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:** [February 10, 2003, 5:20am UTC](https://forum.kirupa.com/t/asd-movement-and-repeat/13194/3 "2003-02-10T05:20:18Z")

</div>

Thanks man…

Also, thanks for getting me up to date, been living in the past with telltarget for too long, everything works now!

Thanks again,  
KoRRupt

---

<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:** [February 10, 2003, 5:22am UTC](https://forum.kirupa.com/t/asd-movement-and-repeat/13194/4 "2003-02-10T05:22:39Z")

</div>

No problem man. I learned with MX so I never knew tellTargeting (for the first week or so of AS learning that is) so when I saw it on the forum I was like… Huh? What is that?!..lol.

Funny how things work 🙂

Glad you got everything working now :beam:
