This is topic Problem with hittest in flash 8 in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=048069

Posted by Blayne Bradley (Member # 8565) on :
 
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.
 
Posted by Blayne Bradley (Member # 8565) on :
 
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.
 


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