A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] [help] attach and remove mc

Hybrid View

  1. #1
    Ihoss
    Guest

    resolved [RESOLVED] [help] attach and remove mc

    i got a problem in my game. i want to check if a ball is below a line and if it does, it should attach a ball to another mc and reomve itself. the porblem is that it seems to remove both. here is the code:

    code:

    _x += Math.round(Math.random()*4)-2;
    _y += 2;
    if (_y>300) {
    _root.snow.i++;
    _root.snow.attachMovie("snow2", "s"+_root.snow.i, _root.snow.i);
    _root.snow["s"+_root.snow.i]._x = _x;
    trace(_root.snow["s"+_root.snow.i]._x);
    _root.snow["s"+_root.snow.i]._y = _y;
    _root.snow["s"+_root.snow.i].gotoAndStop(2);
    removeMovieClip(this);
    }



    this is in hte first frame (because it is attached). any help please

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Cant see anything wrong with your code.

  3. #3
    Ihoss
    Guest
    if i create an mc and let the movie play to the end (so it goes back to the begining), is the created mc destroyed?

    *edit* fixed. seems like if u give the attached mc a depth of less than 0 it will be removed at the end of the frame.

  4. #4
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Originally posted by Ihoss
    if i create an mc and let the movie play to the end (so it goes back to the begining), is the created mc destroyed?
    No. You have to remove it by code.

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