Remove all duplicate clips
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Remove all duplicate clips

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    13
    How do I remove all duplicate clips without given its name ... it is possible ?

    (In game, it creates duplicate clips and all duplicated clips have to be removed when restarting game)

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    44

    Unhappy

    You can use this function:

    Code:
    function RemoveAllMC(){
    for (thisClip in _root){
    	if (typeof(_root[thisClip]) == "movieclip"){
    	_root[thisClip].removeMovieClip();
    	}
    	}
    }
    This function removes all duplicated movie clips,
    If you want to remove specified MC`s add, condition :

    for example:
    this removes all MC`s which name starts from "MC"
    Code:
    if ((typeof(_root[thisClip]) == "movieclip") && (String(_root[thisClip]._name).substr(0,2)=="MC")){
      _root[thisClip].removeMovieClip();
    }
    That`s all...

    ZeroIQ

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

Poll by Flashkit.com