We have a client server architecture where a C++ server talks to Flash clients. I'm developing the server and would like to send through tcp an xy coord to simulate a button press where the receiving flash client would find the topmost visible object at that coord and send a mouse event to it such that we could simulate play without a human present.
I'm told this is incredibly difficult, but it seems to me that there must be a way to do this without too much pain.
Am I off the mark? Or is there a mechanism in flash to iterate through all objects regardless of parent child relationships to find a visible button at an x, y coord and signal a press event?
Thanks in advance for any help.
The function getObjectsUnderPoint in AS3 will give you an Array of all objects under the point you pass in.
var obj:Array = getObjectsUnderPoint(new Point(5,5));
This will give you all objects under the point 5,5.
I haven't used this, so I don't know what the order of the objects in the Array is. Likely, the first object in the array (  ) will be the top-most, but you will have to test to be certain.
From there, its a matter of telling that object to dispatch an event:
Thanks! I'll give this a try.