optimize the structure of flash.js, the original approach may have recursive call stack error