converts as3 2 js