The main difference in ACTION and FUNCTION is the ability to attach the ACTION to an entity within WED. If it is being created in runtime then FUNCTION will work and not clutter up the ACTION property window in WED.