the defend your castle thing isn't hard
the stick figure attacker is just a button embeded into an mc. If it is still on the ground it just runs toward the castle walls until it hits it and runs the attack movieclip
how far you throw it is where it gets a little tricky. let's say that
xvector = _x
yvector = _y
this is placed at the very end of the script, ok? so that the variables xvector and yvector are equal to _x and _y of the attacker. now when you release it, it's _x and _y is going to be different from xvector and yvector because enterframe isn't instantaneous.
therefore:
xdiff = _x - xvector
ydiff = _y - yvector
then all it does is just go through the air with a velocity of xdiff and a velovity of ydiff that's constantly being altered by a falling acceleration.