Hi,
Im new to flash and im trying to make a game. Im stuck on hitTest. I have many black boxes fallling down and i want the game to reset when the black boxes touch my red circle. I used this code for my boxes:
[AS]
this.createEmptyMovieClip(''canvas_mc'',10);Help with hitTestuse:
this.createEmptyMovieClip(''canvas_mc'',10);Help with hitTest
I just tried that. I cant get it to work. The boxes dont fall and there is an error in line 19. It says function name expected. Im not sure what you have to do.
between my code and yours is a straggler: function
delete that.
for the boxes to fall make your attached box tween from stage top to stage bottom and on its last frame attach:
parent.mcA.splice(indexOf(mcA,this));
this.removeMovieClip();
function indexOf(a:Array,mc:MovieClip):Number{
for(var i=0;i%26lt;a.length;i++){
if(a[i]==mc){
return i;
}
}
}
That solved the errors i was getting but nothing is happening. The boxes are just falling throught the red circle.
Im not sure what to put in line 12 (''// +hittest. do whatever''). I want it to go back to frame one which is called ''start1''
i didn't know exactly what you wanted to do when there's a positive hittest.?that's why i inserted the comment about a positive hittest.
that's the place where you should place your code that does what you want:?ie, _root.gotoAndPlay(''start1'') or gotoAndStop()
No comments:
Post a Comment