# Giving AS to all

**URL:** <https://forum.kirupa.com/t/giving-as-to-all/252850>\
**Category:** flash\
**Created:** [February 24, 2008, 12:40pm UTC](https://forum.kirupa.com/t/giving-as-to-all/252850 "2008-02-24T12:40:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IAmBadWithAS](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@IAmBadWithAS](https://forum.kirupa.com/u/IAmBadWithAS)\
**Post date:** [February 24, 2008, 12:40pm UTC](https://forum.kirupa.com/t/giving-as-to-all/252850/1 "2008-02-24T12:40:59Z")

</div>

Hey, How’d you make it so that you can give action script to everything, which has “enemy” in the instance name, (Such as enemy1, enemy2, enemy3 ect.)

So you would put action in the main frames, that would give the actions to enemy1, enemy2, enemy3, and so on.

(Btw, Say that the action was:

```
if (this.hitTest(_root.bulleter)) {
    enemyspeed = 0;
    enemystepsright = 0;
    enemystepsleft = 0;
    dead = true;
    this.gotoAndStop("dead");
}

```

Thanks 😃
