PDA

View Full Version : Hit Test Help


sasamaker
08-23-2006, 06:59 PM
I've Tried The One in This Page (http://forums.xgenstudios.com/showthread.php?t=66424)

And No Luck
I've Tried every Thing,

Help Please :P

I've Tried This Also

if (this.hitTest(step)) {
gotoAndStop(3)
}
}

P.s. Im New So Make It Simple






send me a fla example please!

MaxTwenty
08-23-2006, 07:17 PM
Well, for one thing, that second } isn't needed. Also, (step) refers to nothing. If (step) is on the main timeline, you can point to it with _root.step, but not step alone.

sasamaker
08-23-2006, 07:37 PM
Well That Helps :P
Thanks Letme Try It

And ignore The Second "}"

Edit:
Example Plz, Since Its Still Not Working xD

Ok, I Have My Charecter As man

And In Teh Door I have
onClipEvent (enterFrame) {
if (this.hitTest(_root.man)) {
gotoAndStop(3)
}
}

and It dont Work

foot
08-24-2006, 05:11 AM
Well That Helps :P
Thanks Letme Try It

And ignore The Second "}"

Edit:
Example Plz, Since Its Still Not Working xD

Ok, I Have My Charecter As man

And In Teh Door I have
onClipEvent (enterFrame) {
if (this.hitTest(_root.man)) {
gotoAndStop(3)
}
}

and It dont Work

I'm not an expert, so lision to others over me, but what may be wrong is that it's doing the hit test fine, but it's only doing it once. In the door, are there at least 2 frames that loop?

Matt
08-24-2006, 06:20 AM
onClipEvent (enterFrame) {
if (this.hitTest(_root.man)) {
_root.gotoAndStop(3)
}
}
If yo uwant to goto the 3rd frame on the main timeline you need the _root. to tell that your moving on the main timeline.

sasamaker
08-24-2006, 09:10 AM
Theres Three Frames
Grr
God!

Just Send Me A .Fla Plz!!!!!

Matt
08-24-2006, 10:05 AM
Check your instance names.

sasamaker
08-24-2006, 10:23 AM
I Got It No Worries
Thanks Tho
lol

Edit:
:'(
Now When I Say "_root.gotoAndStop(3)"
It Goes To Frame One!!
:'( :'(

Help Plz

GorillaStudios
08-28-2006, 06:32 PM
What else do you want it to do when it hits that movieclip?

You can put this on the main timeline to keep things organized:

_root.character.onEnterFrame = function() {
if (this.hitTest(_root.women)) {
// If you hit the movieclip 'women'
_root.gotoAndStop(3);
// It will goto frame 3 on the timeline
}
};

Otherwise you can put this directly on the movieclip
onClipEvent (enterFrame) {
if (this.hitTest(_root.women)) {
// If you hit the movieclip 'women'
_root.gotoAndStop(3);
// It will goto frame 3 on the timeline
}
}

Remember you must have your movieclip instance names correct. The movieclip instance that you want the code to be triggerd on is called 'women', just women on its own.

nashi989
09-01-2006, 02:01 AM
It probably goes to frame 1 because there is no stop(); in frame 3 of the man mc.

Lui
09-01-2006, 03:05 AM
Tundanananuuun! Lui is here!

Well, make sure the frame your going to has a stop action on it, or the animation ahead of it that you want to play. Then you may add..


onClipEvent (enterFrame){
if (this.hitTest(_root.instancename)){
gotoAndStop(framenumber);
}
}


Change the instancename and framenumber on whatever you want them to be.

Tantuddudum!