Hello,
I have been using flash for a while now 2 years or so, but I have never come across this before and I am stumped. I have a game I am making and there are dozens of buttons, but 5-6 of them for reasons unknown only have a hit test of about 6% of the actual button. Strange little places on the image where the hit tests work. I have tried adding a transparent square over the top in all states including the hit state and it still doesn't pick up the hit frame or the image.
I have tried deleting the few buttons and creating new symbols and dropping them in but still the same issue. The only script I have on the frame is a few if statements and a few for loops.
I have spent the last 2 days googling around and only found about 5-6 posts regarding this and all of them were un-answered, I'm hoping one of you skilled developers might know what's causing this and if so what the fix is. Thanks!
Code:
AttackMinion.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3);
function fl_MouseClickHandler_3(event:MouseEvent):void
{
if (Object(root).CurrentTurn == 1)
{
Object(root).Player1Action = 1;
Object(root).Player1XP += AttackCardCount;
Object(root).Player1AttackCount -= AttackCardCount;
if (Object(root).Player1Passive == 1)
{
Object(root).Player1RetDmg += Math.floor(AttackCardCount/2);
if (Object(root).Player1RetDmg >= 1)
{
Object(root).Player1RetDmg -= 1;
}
}
else
{
Object(root).Player1RetDmg += Math.floor(AttackCardCount/2);
}
Object(root).Player1RetDmg -= Object(root).Player1Armour
for (i=1; i<=Object(root).Player1RetDmg; i++)
{
Object(root).Player1Discard.push(new AsheWoundDraw());
}
for (i=1; i<=AttackCardCount; i++)
{
Object(root).Player1Discard.push(new AsheAttackDraw());
}
this.gotoAndStop(1);
}
else if (Object(root).CurrentTurn == 2)
{
Object(root).Player2Action = 1;
Object(root).Player2XP += AttackCardCount;
Object(root).Player2AttackCount -= AttackCardCount;
if (Object(root).Player2Passive == 1)
{
Object(root).Player2RetDmg += Math.floor(AttackCardCount/2);
if (Object(root).Player2RetDmg >= 1)
{
Object(root).Player2RetDmg -= 1;
}
}
else
{
Object(root).Player2RetDmg += Math.floor(AttackCardCount/2);
}
Object(root).Player2RetDmg -= Object(root).Player2Armour
for (i=1; i<=Object(root).Player2RetDmg; i++)
{
Object(root).Player2Discard.push(new AsheWoundDraw());
}
for (i=1; i<=AttackCardCount; i++)
{
Object(root).Player2Discard.push(new AsheAttackDraw());
}
this.gotoAndStop(1);
}
}