A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: need help with a small peice of actionscript

  1. #1
    Senior Member
    Join Date
    Aug 2005
    Posts
    225

    need help with a small peice of actionscript

    life = 100;
    onEnterFrame = function () {
    if (life<=0) {
    this.removeMovieClip();
    }
    life_txt.text = life;
    };
    i have this code inside an enemy mc on it's first and only frame and i know that it's life is getting lower via what im reading off of life_txt but for some reason the mc wont remove itself when it's life is below 0.

  2. #2
    Style Through Simplicity alillm's Avatar
    Join Date
    Mar 2004
    Location
    Wales
    Posts
    1,988
    Did you attach the movie clip in the first place? removeMovieClip() wont work unless you attached it in the first place.

    Ali

  3. #3
    Senior Member
    Join Date
    Aug 2005
    Posts
    225
    Quote Originally Posted by alillm
    Did you attach the movie clip in the first place? removeMovieClip() wont work unless you attached it in the first place.

    Ali
    lol. i didn't. thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center