never worked with actionscript or flash before but from my understanding setInterval performs a certain action after a set amount of time right?
so if I went:
setInterval( getX(), 1000 );
it would call getX() every 1000 milliseconds right?
this would be the Arduino equivalent:
//whatever you want the function to do
then inside your setup:
and in your main loop:
NOTE: this is assuming your loop completes multiple times in a second. This will not work if you want to set an interval at a time smaller than which it takes the program to loop through once. If thats the case you would be looking at interrupts.