[mx]Hittest Loop

Ok can someone post an example of a loop that uses duplicate and runs a hit test

my code does not work at ALL :-\ And Im not even sure how duplicatemovieclip works…does the new movieclip inhereit all the actionscript that the old one has? :-\



	for (x=1; x<3; x++) {
		_root.pal.duplicateMovieClip("pall"+x, x);
		for (i=1; i<3; i++) {
			if (_root.heroz.ron.hitTest(_root["pall"+i])) {
			_root["pall"+i]._visible=0
			}


the clip goes invisible for a single frame and then just goes back to being normal when it hits the other mc…I suck :frowning:

change

if (_root.heroz.ron.hitTest(_root["pall"+i])) {
			_root["pall"+i]._visible=0
			}

to

_root.heroz.ron.hitTest(_root["pall"+i]) ? _root["pall"+i]._visible=false : _root["pall"+i]._visible=true;

should work just fine :wink:

*Originally posted by fluid_0ne *
**

_root.heroz.ron.hitTest(_root["pall"+i]) ? _root["pall"+i]._visible=false : _root["pall"+i]._visible=true;

**

ok, you confused me(not like it’s hard or anything)