3 Replies Latest reply on Oct 12, 2009 12:52 PM by Ned Murphy

    Actionscript code not working someone please check it

    xrox2

      well i am making a game where you shoot planes and my shooting actionscript doesnt seem to work and im not sure why.

       

      onClipEvent (load) {
          moveSpeed = 10;
      _root.bullet._visible = false
      bulletCounter = 1;
      bulletSpeed = 17;
      this._x = _root.plane._x;
      this._y = _root.plane._y-30;
      }
      onClipEvent (enterFrame) {
      this._y -= bulletSpeed;
      if (this._y<=-50) {
      this.removeMovieClip();
      }
      }
      if (Key.isDown(Key.SPACE)) {
      bulletCounter++;
      _root.bullet.duplicateMovieClip("bullet"+bulletCounter, bulletCounter);
      _root["bullet"+bulletCounter]._visible = true;
      }

       

      It seems right but when i try it out it says in the out put box Scene=Scene 1, Layer=Layer 1, Frame=1: Line 15: Statement must appear within on/onClipEvent handler
           if (Key.isDown(Key.SPACE)) {

       

      can someone help me

       

      -xrox2