00:00
00:00
Newgrounds Background Image Theme

christopher54000 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Flash: Compare Array's

319 Views | 1 Reply
New Topic Respond to this Topic

trying to check if a specific element in the array is equal to a string, so that i can then do something if it hits that specific object. if array is == "object1" and if array is == "object2"...

if (myBoat.hitTestObject(myCounterArray[i]) == true) 
{
	trace(myCounterArray[i] + i);

	if(myCounterArray[i] == "myCounter")
        {
		scoreBoard.theScore += myCounter.counter;
		scoreBoard.updateScore();
		displayCountDown.countDown += 5;
		displayCountDown.updateTimer();
		removeChild(myCounterArray[i]);
		myCounterArray.splice(i, 1);
	}
}

Response to Flash: Compare Array's 2015-03-26 08:51:53


SOLVED! i didnt need to compare to a string as i push objects in... i realised when i wrote the post.