There's a good example in the "Technical Archive"
http://www.agsforums.com/yabb/index.php?board=10;action=display;threadid=8303
that should be what you're looking for
http://www.agsforums.com/yabb/index.php?board=10;action=display;threadid=8303
that should be what you're looking for