ActionScript deferred/promise implementation