Hi Guys an Gals
I am trying to make a small game just for fun and have hit a wall though am sure the answer is so simple. Its so foggy here anyway:-)
I have a rolling displayobject calles Roller that goes back and forth across the screen. In its path from time to time are other DisplayObjects. I need to get the name of the object that Roller hits and pass to a switch statement.
The follow code snippet compiles and the hit is detected but the switch always returns default: Does anyone have any idea how to solve this please. Best regards, Frederick.
if (theRoller.hitTestObject(target))
{
trace("Current target"); // [object Erikpl]
switch (target)
{
case "[object Erikpl]"):
trace(" Erikpl Hit",target);
break;
default:
//trace ("Nothing was selected, solve the problem");
}
}