FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » Problem with hittest in flash 8

   
Author Topic: Problem with hittest in flash 8
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
k, I have a shopping cart, and I have 6 items, and a hittest, when i drop the item into the shopping cart it is supposed to disappear and give me a total.

So far, when i try to test it, like I move the item, and drop it, and I have a trace to test if it hits, so far it seems that the hittest tests as true NO MATTER WHERE I choose to drop the item.

code:

code:
COD_mc.onPress = makenew;

function makenew()
{
this.duplicateMovieClip( "my"+m_cnt+"_mc", m_depth, "my"+m_cnt+"_mc");
eval("my"+m_cnt+"_mc").startDrag();
eval("my"+m_cnt+"_mc").onPress = Prs;
eval("my"+m_cnt+"_mc").onRelease = Rel;
m_cnt++;
m_depth++;
}

function Prs()
{
this.startDrag();
}

function Rel()
{
this.stopDrag();
//onClipEvent(enterFrame)
//{
if (this, hitTest(Cart_mc))
{
trace("Hit!"+this);
}
else
{
trace("Missed :("+this);
}
//}
}

It seems that this (being what I am dragging) and the Cart will always test as hitting no matter where I drop the item. Is there something I am missing here.
IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
Ok after some more googling ive found someone who did it as if ( this.hittest(movieclup)){ actions }

which makes alot more sense and seems to work.

IP: Logged | Report this post to a Moderator
   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2