Skip to main content
Known Participant
November 4, 2007
Question

hitArea hide movie clip

  • November 4, 2007
  • 11 replies
  • 627 views
Im trying to hide a clip on when one clips collide with another using hit Tes and also hitArea, both of them doesnt work....
I write the following code:


onClipEvent (enterFrame) {
if (_root.guardia, hitTest(_root.quienes)) {
hide == true;
} else {
hide == false;
}
}


Is something there i mess?

best,
IN
This topic has been closed for replies.

11 replies

Inspiring
November 27, 2007
Are you thinking that just assigning a variable called hide will make this go away? That won't work. There has to be someplace where you do something based on the value of hide?

It seems like a silly question, but it really isn't. How do you know this isn't working? Are you tracing the value of hide?
kglad
Community Expert
Community Expert
November 26, 2007
and it shouldn't work.

on what timeline do you use hide?
Known Participant
November 26, 2007
All the mc that start on Scene 1


The timeline of instance "quienes" in Scene 1 is inside a buttom and the mc is called quienes

Scene 1 -> asisomos buttom / over / -> mc Sombolo 3 - > mc quienes


The time line of instance guardia in Scene 1 is in

Scene 1 -> guardia mc

Hide is in Timeline Scene 1

thank you in advance
in
Known Participant
November 26, 2007
ok im understanding

"guardia" is the instance name of the mc also is a layer on scene 1
"quienes" is the instance name of the mc that is inside a mouse over buttom that is on scene 1

the action (the code) is inside frame 1 that is in other layer on scene 1


I try these as you said:

onClipEvent (enterFrame) {
if (_root.guardia.hitTest(_root.quienes)) {
guardia.hide =true;
} else {
guardia.hide =false;
}
}

but still doesnt work
in
kglad
Community Expert
Community Expert
November 24, 2007
yes, i meant hide. and as implied previously, if you're trying to use hide outside the scope of that movieclip, you can't just use "hide": you'll need something like:

yourMCInstanceName.hide;
Inspiring
November 24, 2007
I think he means where is "hide" used.

If guardia and quienes are both on the _root timeline then that code should correctly assign the hide value. You say it "doesn't work" but you haven't really told us what doesn't work and how you know it doesn't work.
Known Participant
November 24, 2007
sorry i dont understand what you are asking could you ber so kind to be more extensive in your question so i could give you more information

thanks,
in
kglad
Community Expert
Community Expert
November 24, 2007
where is hit used?
Known Participant
November 23, 2007
the code is attach to the movieclip called guardia and a the other one is a clip called quienes. There is no syntax error but i dont know whats going on

in
kglad
Community Expert
Community Expert
November 4, 2007
_root.guardia is not the correct path/name or _root.quienes is not the correct path/name or hide is incorrect.

the only place you're using hide is within the movieclip that has that code attached?
Known Participant
November 4, 2007
i tested

onClipEvent (enterFrame) {
if (_root.guardia.hitTest(_root.quienes)) {
hide =true;
} else {
hide =false;
}
}

and doesnt work. one of the clips (guardia) is on a button mouse over state. i made two clips without htat configuration but dosnt work at all. any possible answer?