A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Tracing all instances on the stage

  1. #1
    Senior Member
    Join Date
    May 2005
    Location
    Wisconsin
    Posts
    181

    Tracing all instances on the stage

    Is there a way to trace all movie clips instances on the stage? Im attaching and removign clips threw a loop and cant tell if there gettign removed is there a way to trace all instances curringt in the movie?

  2. #2
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    to trace all the instances on _root level use:

    Code:
    for(var z in _root){
        if(_root[z] instanceof MovieClip){
            trace(_root[z])
        }
    }
    to trace all the instances on the stage i.e child and parent clips, use:
    Code:
    function getAllInstances(level){
    	for(var z in level){
    		if(level[z] instanceof MovieClip){
    			trace(level[z])
    			getAllInstances(level[z])
    		}
    	}
    } 
    getAllInstances(_root)
    but if you only want the instances, on say the _root level, then use the first script as it will be more efficient,

    HTH,

    zlatan
    New sig soon

  3. #3
    Senior Member
    Join Date
    May 2005
    Location
    Wisconsin
    Posts
    181
    Quote Originally Posted by dudeqwerty
    to trace all the instances on _root level use:

    Code:
    for(var z in _root){
        if(_root[z] instanceof MovieClip){
            trace(_root[z])
        }
    }
    to trace all the instances on the stage i.e child and parent clips, use:
    Code:
    function getAllInstances(level){
    	for(var z in level){
    		if(level[z] instanceof MovieClip){
    			trace(level[z])
    			getAllInstances(level[z])
    		}
    	}
    } 
    getAllInstances(_root)
    but if you only want the instances, on say the _root level, then use the first script as it will be more efficient,

    HTH,

    zlatan
    Thanks allot ill try that!!!!!!!!!

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