• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

how to get hitTestObject to remove value

Community Beginner ,
Sep 09, 2018 Sep 09, 2018

Copy link to clipboard

Copied

I shorten the code considerably to make it easier to understand the problem I am having. the problem is it works the first time but then after that it lets me hit the object(abox) anywhere on the screen and it registers true

abox and bboxes are movie clips in an array

function fl_ReleaseToDrop(e:MouseEvent):void

{

this.stopDrag();  ///////////////////////this is abox

for (var k:Number=0; k<=abox.length-1;k++){

for (var f:Number=0; f<=bbox.length-1;f++){

if ((bbox.hitTestObject(abox))&&(abox.abctext.text == bbox.abctext.text)){

trace("hit")

}}}

TOPICS
ActionScript

Views

247

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 09, 2018 Sep 09, 2018

there's nothing in the code you showed that would change between the nth time that code executed and the n+1st time.

Votes

Translate

Translate
Community Expert ,
Sep 09, 2018 Sep 09, 2018

Copy link to clipboard

Copied

there's nothing in the code you showed that would change between the nth time that code executed and the n+1st time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 09, 2018 Sep 09, 2018

Copy link to clipboard

Copied

yea messed up I had abox.x = bbox.x and  abox.y = bbox.y

sorry

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2018 Sep 09, 2018

Copy link to clipboard

Copied

LATEST

no problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines