actionscript 3 - FileReference.save() is not working stable on browser as3 -
i use filereference.save() in 4 different place in flash game. 4 methods same (copy & paste). locally, 4 work when put swf in browser, facebook actually, 1 of them works expected , others not. in chrome, 3 have never worked. in safari, work nondeterministic. can reason? idea?
by way, compiled air 2.5 , air 3.2 desktop, use flash cs6
private function onscreenshotbuttonclicked(e:mouseevent) { mscreenshotbutton.removeeventlistener(mouseevent.click, onscreenshotbuttonclicked); var finalbitmapdata:bitmapdata = new bitmapdata(810, 520, true, 0x00000000); var finalbitmap:bitmap = new bitmap(finalbitmapdata, pixelsnapping.always, false); finalbitmapdata.draw(mparent.root); var finaldata:bytearray = new bytearray(); finaldata = pngsave.encode(finalbitmapdata); var tempfilereference:filereference = new filereference(); tempfilereference.addeventlistener(event.complete, onsavecompleted); tempfilereference.addeventlistener(event.cancel, onsavecancelled); tempfilereference.save(finaldata, "boombox.png"); }
the common problem method dont't have mouseevent instance param. may call filereference.save () don't have event argument in function.
Comments
Post a Comment