hitTestObject checking collision with pattern
I've got an enter frame event that checks collision between mouse cursor and objects on the screen. The problem. Every object has a name, however I want to detect collisions between the cursor and objects with a pattern name.
For example, on the screen there are five objects called
XObj1
AObj2
XObj3
XObj4
AObj5
I want to check collision only between mouse cursor and every object that starts with X or A.
The solution I had doesn't work out the way I expected because it runs a loop and returns array with an index of these objects. I would like to have a straightforward approach like
MouseCursor.hitTestObject(stage.getChildByName(Pattern));
But I don't know if it's possible.
Thanks in advance
