A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: CS4-AS2-Can a MovieClip see its own name?

Threaded View

  1. #1
    Member
    Join Date
    Jan 2008
    Posts
    37

    CS4-AS2-Can a MovieClip see its own name?

    Well I want a movieclip to stop movie if it touches another movieclip that is in an Array, only problem is this movie Clip is also included in this movieclip.

    Code:
    ex. 
    //in First Frame//
    array = [_root.thing1, _root.thing2, _root.thing3]
    
    //inside thing1//
    for (i=0;i<_root.array;++i){
    if (this.hitTest (_root.array[i])){
    stop();}}

    Edit:

    So I was messing around with this to try and figure out what was wrong and I found that the Original monster can detect all its clones, and all its clones can detect the original, but the clones cant detect eachother.

    This is how I make clones of Thing
    Code:
    onClipEvent (load) {
    	ad = 1;
    }
    //in another MovieClip i have it add +1 to _root.thingnum every 2 secs to make them spawn for me//
    onClipEvent (enterFrame) {
    	if (_root.thingnum>ad) {
    		duplicateMovieClip("_root.thing", "thing"+ad, ad);
    		if (ad>1000) {
    			ad = 1;
    		} else {
    			ad++;
    		}
    	}
    }
    Does the Detection error have something to do with cloning? or What exactly am I doing wrong?

    so Ya main Questions:

    1. Is Cloning stopping Scripts?
    2. Am I calling the Collision Detection correctly?
    3. Can MovieClips see their Own Name?
    4. Am I going crazy from lack of sleep?
    Last edited by Degraiver; 12-30-2009 at 06:18 PM. Reason: New info was gathered.

Tags for this Thread

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