I’m running a Flash movie containing a moving object, used for a vision science experiment. I’m using an eye tracking device to monitor the eye movements made when following the stimulus on screen. Flash seems like a good option for controlling my stimulus as it allows vector scaling and smooth stimulus motion.
The eye tracker is running using MATLAB. I’d like to output the co-ordinates of the object from ActionScript to MATLAB so that in my final data output I can compare the stimulus position to eye position.
I understand that I may be able to communicate from AS to MATLAB via TCP/IP (although the actual procedure is alien to me), and wonder how I would go about extracting X and Y co-ordinates of an object (a circle object) and sending them to MATLAB?
Any help would be greatly appreciated
I don’t know much about MATLAB and how to program for it but I’ll give you an example on the AS3 side. If you want to use the TCP/IP communication first of all you’ll need to define a server and a client. ServerSocket class is only supported for AIR applicaitons on the Flash side so you should decide whether to make Flash side server or client. In case you want it to be server you’ll need to write something like this:
If you’ll decide client for the Flash side connect to your server like this:
Then you can communicate using the same methods for writing and reading.