A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: remove mc after hittest()

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    22
    Can anybody tell me how to remove a mc after colliding with another mc. Tell me where to put this piece of code

    hkhyd

  2. #2
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Put it after your hitTest() code ... if the instance you want to remove was programatically placed (i.e. duplicated) you can use removeMovieClip(). However, if the clip was placed in the authoring environment, you will need to use unloadMovieClip() - this won't remove the clip completely ... it will only delete the contents of the clip's timeline, making it look like you have deleted the clip.

    If you need any more help, mail me or post again.

  3. #3
    Junior Member
    Join Date
    Jan 2001
    Posts
    22
    thanks, I have placed the removemovieclip() after the hittest()in the mc (generated through a duplicatemovieclip()), but it is also removing all the mc's (three mc's generated by a duplicatemovieclip() in a for loop)leaving only one. how to avoid this.

    -----------------------------------------------------
    Originally posted by hkhyd
    Can anybody tell me how to remove a mc after colliding with another mc. Tell me where to put this piece of code

    hkhyd

  4. #4
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Why are you removing clips using a for loop? Surely if you only want to remove one clip you name that clip in the actions:

    removeMovieClip ("_root.myClip");

  5. #5
    Junior Member
    Join Date
    Jan 2002
    Location
    Mumbai (Bombay) India.
    Posts
    13

    similler prob. :(

    Originally posted by garbage
    Why are you removing clips using a for loop? Surely if you only want to remove one clip you name that clip in the actions:

    removeMovieClip ("_root.myClip");
    __________________________________________________ _________
    I'm also having prob. while removing the movie clip, on rollOver, i have 4 movie clip on my main timeline, and in each movie clip i have drop down menu. but prob. is if i click on any button which is inside in the movieClip, when i click for second button tht one gets up to the 1st. means shows both, when i want to remove 1st movie clip, if i rollOver on second movieClip.
    now pls help me some 1. i was trying it from so many times. (

  6. #6
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    sudhirrr, I'm not sure we're on the same page. You are talking about drop-down menus, and this thread is dealing with removing movie clips. Are you trying to say that to make a drop-down menu you are duplicating and removing movie clips? There is an easier way, you know ...

    Have a look in the tutorials section, and get yourself a tutorial on building drop-down menus. It's a lot more simple than the way you are attempting it.

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