PDA

View Full Version : [mx]Hittest Loop



Cowien
July 24th, 2003, 04:55 PM
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 :(

fluid_0ne
July 25th, 2003, 03:43 AM
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 ;)

norie
July 26th, 2003, 09:39 PM
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)