help please

  • brentjlaf
  • Student
  • Student
  • User avatar
  • Posts: 67

Post 3+ Months Ago

I have the following code on a movieclip, what i want to happen is for the ball thats controlled but the arrow keys to disappear when it goes over a selected area.

Any help would be great


Code: [ Select ]


  onClipEvent (load) {

      step = 10;

      movieWidth = 250;

      movieHeight = 200;

      hitAreax = 100;

      hitAreay = 100;

  }

  onClipEvent (enterFrame) {

      if (Key.isDown(Key.RIGHT) && this._x<movieWidth) {

          this._x += step;

      } else if (Key.isDown(Key.LEFT) && this._x>0) {

          this._x -= step;

      } else if (Key.isDown(Key.UP) && this._y>0) {

          this._y -= step;

      } else if (Key.isDown(Key.DOWN) && this._y<movieHeight) {

          this._y += step;

      }

  }

  onClipEvent (enterFrame) {

      if (this._x<hitAreax) {

          (gotoAndStop(2));

      } else if (this._x<hitAreay) {

          (gotoAndStop(2));

      }

  }
  1.   onClipEvent (load) {
  2.       step = 10;
  3.       movieWidth = 250;
  4.       movieHeight = 200;
  5.       hitAreax = 100;
  6.       hitAreay = 100;
  7.   }
  8.   onClipEvent (enterFrame) {
  9.       if (Key.isDown(Key.RIGHT) && this._x<movieWidth) {
  10.           this._x += step;
  11.       } else if (Key.isDown(Key.LEFT) && this._x>0) {
  12.           this._x -= step;
  13.       } else if (Key.isDown(Key.UP) && this._y>0) {
  14.           this._y -= step;
  15.       } else if (Key.isDown(Key.DOWN) && this._y<movieHeight) {
  16.           this._y += step;
  17.       }
  18.   }
  19.   onClipEvent (enterFrame) {
  20.       if (this._x<hitAreax) {
  21.           (gotoAndStop(2));
  22.       } else if (this._x<hitAreay) {
  23.           (gotoAndStop(2));
  24.       }
  25.   }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

i think it`s
Code: [ Select ]
onClipEvent (enterFrame) {

    if (this._x<hitAreax && this._y<hitAreay) {

     gotoAndStop(2);

    }
  }
  1. onClipEvent (enterFrame) {
  2.     if (this._x<hitAreax && this._y<hitAreay) {
  3.      gotoAndStop(2);
  4.     }
  5.   }

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 18 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.