attach flexInit to window