[As3] generate value cast to Function using "as" (closes #2200)