mc1 is the mc that when the bullet hit him, the points should be increased in 1.
points is a dynamic text that the points should be displayed in there.
if mc1 and bullet were created dynamicly, i.e. with attachMovie of duplicateMovieClip, then you can use
code:
mc1.removeMovieClip();
bullet.removeMovieClip();
"wen i found my gerbil dead my other gerbil was eating it i just cried and screamed" http://www.livescripts.net
-------------------------------------------------------------------------------- Last edited by some moderator : Today at 9:01 PM.
If you are creating the movieclips dynamically using "attachMovie" or "duplicateMovieClip" commands, then you would add the following to your 'if' statement:
code:
removeMovieClip(_root.mc1); // removes MC 'mc1'.
this.removeMovieClip(); // removes the bullet
If you added the movieclips to the stage at author time, then you use these instead:
code:
unloadMovie(_root.mc1); // removes MC 'mc1'.
this.unloadMovie(); // removes the bullet
Back to your original problem:
Your code is fine. there is something else wrong and it is hard to tell without a fla, but here are some things that could go wrong:
a. make sure you are placing your code in the right movie clip (NOT mc1 in your case)
b. Make sure the Instance name is "mc1" not only the name you as-sinned it when you clicked convert to symbol or new symbol.
c. Make sure the dynamic text box (or wherever you are displaying the points) has "_root.points" in the "Var" field, NOT the instance name.
d. If none of the above work, try adding this line under "_root.points+=1;" :
I was silly... I didnt changed the var in the text...
but, I changed the var and then in the text filed I have some tihng like that-
levl10p
WTF? LOL how is that got to there!?
Couldn't look at your code, seemed to be the wrong format, not MX, but I'll tell you some stuff about for loops, what he means. Say you attach bullets like this:
note that this code is very rough, and would probably have to be modified heavily to make it fit. Maybe upload the fla in MX format and I'll see how I could refine it.
Hope this helps.
Derek.