# Little as problem

**URL:** <https://forum.kirupa.com/t/little-as-problem/173314>\
**Category:** Uncategorized\
**Created:** [December 23, 2005, 11:05am UTC](https://forum.kirupa.com/t/little-as-problem/173314 "2005-12-23T11:05:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![woopsedoo](https://avatars.discourse-cdn.com/v4/letter/w/a87d85/32.png) [@woopsedoo](https://forum.kirupa.com/u/woopsedoo)\
**Post date:** [December 23, 2005, 11:05am UTC](https://forum.kirupa.com/t/little-as-problem/173314/1 "2005-12-23T11:05:08Z")

</div>

can somebody please tell me if there is a way of checking to see whether a movie clip is on stage using as? i am making a game and i have an object that can fire in a few directions. i have made it so when you press the space bar, an invisible object attaches the bullet to itself. i have made it interact with the character so it fires in the direction the man is facing. the problem i have is that once you have fired the bullet if the character changes direction the bullet also changes direction. what i want to do is when you press the space bar, i want to put in as a code that checks whether the bullet is on stage and if it is disables it from changing direction. this is the code that i have

```auto
on (keyPress "<Space>") {
 this.attachMovie("laser", "laser", this.getNextHighestDepth());
 this._rotation = _root.rrr;
 this._x = _root.char._x;
 this._y = _root.char._y;
 this.onEnterFrame = function() {
  if (_root.rrr == 0) {
   this._y -= 8;
  }
  if (_root.rrr == 90) {
   this._x += 8;
  }
  if (_root.rrr == 180) {
   this._y += 8;
  }
  if (_root.rrr == 270) {
   this._x -= 8;
  }
  if (_root.rrr == 135) {
   this._x += 8;
   this._y += 8;
  }
  if (_root.rrr == 315) {
   this._x -= 8;
   this._y -= 8;
  }
  if (_root.rrr == 225) {
   this._x -= 8;
   this._y += 8;
  }
  if (_root.rrr == 45) {
   this._x += 8;
   this._y -= 8;
  }
 };
}

```

rrr is a dynamic text box that when a direction is pressed changes number.

any help will be apreciated

thank you
