my hittest works only partially:
hittest is even true when the 2nd mc only touches the blue outline of the mc. does anyone know the answer?
(ive already searched the forums)
my hittest works only partially:
hittest is even true when the 2nd mc only touches the blue outline of the mc. does anyone know the answer?
(ive already searched the forums)
ummm could you be more specific??
imagine ive got 2 mc, both have got a non-rectangle in it. there is a blue border around it (like around any MC/button).
when i do a hittest, AS even sets it to true when the mc only hits the blue line (which is not visible when testing) and not the thing inside the movieclip.
ill post a picture later…
okay if i understand you correctly your using a square as a hit area what you need to do is make a solid square with no border place it on the top layer make sure it covers teh area you want to be the button and then in the color panel set its color to 0% alpha thatll do the trick and you will have a working button
no thats not what i want.
ive got no time now, ill post a pic in the afternoon…
i want to do a hittest, which is true when the two circles hit ech other, and not the blue MC-outline…
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=21582&highlight=hitTest
Thats what my search dug up.
i found that too. but i do not need that with the pixel-x-y-coordinates. i need a hittest that tests the hit of the actual content of the movieclips. but thanks…
i know what you need and that is the answer. YOu need to set the shape-flag to true. You put
hitTest(“mcthatyouwanttohitTest”, [SIZE=10] TRUE [/SIZE] )
thanks.
doesnt work.
thats my code:
[AS]onClipEvent (enterFrame) {
if (this, hitTest("_root.block.shaddow",true)) {
setProperty(_root.block, _y, _root.trans.blocky);
setProperty(_root.block, _x, _root.trans.blockx);
}
}[/AS]
try:
this.hitTest(“MCyouWANTtoHIT”, TRUE)
that might work. I’m not sure, I haven’t used hitTest in forever so I’m a little rusty. If that doesn’t work someone else should be along with the answer
i used your code, and the result is the following:
it doesnt work until i delete the “,true” (without qotations). but then the shape-flag does not work again… help would be much appreciated…
how do u do the email and the shoutbox animation? I have been trying to do dat. When u click the email, it plays an animation then and when u click on the shoutbox, it close the previous animation and then open up the new one. How to give the action to the buttons? Pls advise
with variables and if-statements.
im in school right now and am not able to post the answer right now, but ill post it tomorrow…
next time please PM me, not answer on a post in which i ask for something…
I couldn’t get it to work correctly at all. Its been so long. Oh, well… I just wrote my own prototype for it instead. As long as you are using circles this will work. I attached the file… let me know if this helps
MovieClip.prototype.hit = function (mcClip)
{
this.x1 = this._x;
this.y1 = this._y;
this.xDis = (mcClip._x - this.x1);
this.yDis = (mcClip._y - this.y1);
this.maxD = (this._width / 2) + (mcClip._width / 2);
this.hyp = Math.sqrt ((this.xDis * this.xDis) + (this.yDis * this.yDis));
if (this.hyp < this.maxD)
{
return true;
}
else
{
return false;
}
};
mc1.startDrag (true);
_root.onEnterFrame = function ()
{
mc1.hit (mc2);
};
now, all you have to do is put an if statment like:
if(mc.hit(mc2)){
// do this if true...
}else{
//do this if false...
}
thanks i will try it soon
Yes, just check if their radiuses and distances are close enough to each other.
:: Copyright KIRUPA 2024 //--