-
I dont get hitTest...
Hi,
i have this actionscript and i dont know where to put it to ake it work:
if(obj1.hitTest(obj2)){
gotoAndPlay(frame number or frameLabel)
}
Yeah... where do i put it? on obj1? obj2? the frame on timeline? and also...
what do i do? make another scene and make it play that? and put stop() on the end of the first scene?
please respond =D
Imagination is the creator of reality...
-
FK'n_dog
Movement and simple hittest
http://www.actionscript.org/resource...est/Page1.html
hope this tute helps
if not, Google flash hittest tutorial
-
but i want to know what i can do with THIS actionscript instead:
if(obj1.hitTest(obj2)){
gotoAndPlay(frame number or frameLabel)
}
someone please reply,
Thanks =)
Imagination is the creator of reality...
-
Originally Posted by FlashmanSK
but i want to know what i can do with THIS actionscript instead:
someone please reply,
Thanks =)
Put this code in the frame Actions
Also, if you want to put it into another mc you will have to do this:
if(_root.obj1.hitTest(_root.obj2)){
gotoAndPlay(frame number or frameLabel)
//do something as well if you want
}
By the way, this one is 100% safe
Last edited by Mr.Qwerty; 12-09-2006 at 05:11 PM.
Mr.Qwerty
-
FK'n_dog
offer him a net and all he wants is a fish
sheeesh !!
-
[QUOTE=Mr.Qwerty]Put this code in the frame Actions
what u mean my the Frame Actions, and also, how should my timeline and complete layout be for this to work?
sorry to bother u with all these newbie questions
thanks
Last edited by FlashmanSK; 12-18-2006 at 03:47 PM.
Imagination is the creator of reality...
-
one possibility would be select the first frame
open actions panel
type
_root.onEnterFrame = function(){
if(_root.myMC1.hitTest(_root.myMC2)){
trace("hit!!!")
}
}
-
awesome it works but just one thing...
i wanted it to be like a gotoAndplay thing
sorry, but that is awesome
Imagination is the creator of reality...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|