i've taken the plunge and i'm learning actionscript 2.0!
but i find it hard to follow all the books and resources available to me except direct help, because i'm new to OOP languages.
So onto the main thang,
i'm just going through things making random stuff but using features and learning the syntax, and todays task was hitTest.
but its not working
wondered if you guys could take a look
*DO NOT GIVE ME CORRECTED CODE*
but point me to my error, even explain exactly what it is, but let me figure out what to do by myself, or i won't learn
whew, thats a keyboardfull, thanks guys!
Its not letting me upload my .fla file, so here's the layout
2 movie clips, instance names fgzombmc and ballmc
Code In The Frame :
onEnterFrame = function() {
if (Key.isDown(39)) {
fgzombmc._x += 3
}
if (Key.isDown(37)) {
fgzombmc._x -= 3
}
if (Key.isDown(38)) {
fgzombmc._y -= 3
}
if (Key.isDown(40)) {
fgzombmc._y += 3
}
}
Code In ballmc :
onClipEvent(load)
{
xcorrect = (_root.fgzombmc._width/2);
ycorrect=(_root.fgzombmc._height/2);
}
onClipEvent(enterFrame)
{
if (this.hitTest(_root.fgzombmc._x - xcorrect,_root.fgzombmc._y - ycorrect,true)==true){
this.color = Red
}
}
you experts will grasp this, but my aim is to make the ball go red.
thanks again!

New Topic/Question
Reply


MultiQuote






|