actionscript 3 - ArgumentError: Error #2015: Invalid BitmapData. on iOS -
the simplest graffiti app. code works fine on desktop , on android. if try same on ios (tested on real device - ipad 2), error: argumenterror: error # 2015: invalid bitmapdata.
in principle, clear why error - size of bitmapdata huge.
why happens? , why on ios?
private var maskline:sprite = new sprite(); stage.addeventlistener(mouseevent.mouse_move,onmove); stage.addeventlistener(mouseevent.mouse_down,ondown); stage.addeventlistener(mouseevent.mouse_up,onup); protected function ondown(ev:mouseevent):void { maskline.graphics.linestyle(20, 0x33cc00, 1); maskline.graphics.moveto(mousex, mousey); stage.addeventlistener(mouseevent.mouse_move, onmove); } protected function onup(ev:mouseevent):void { stage.removeeventlistener(mouseevent.mouse_move, onmove); } protected function onmove(ev:mouseevent):void { maskline.graphics.lineto(mousex, mousey); } save in bitmap code:
maskline.filters = [new blurfilter(4, 4, 1)]; trace (capabilities.screenresolutionx + ' ' + capabilities.screenresolutiony + ' ' + maskline.width + ' ' + maskline.height); //768 1024 107374182.35 107374182.35 // here error var bmpd:bitmapdata = new bitmapdata(maskline.width, maskline.height, true, 0x000000); bmpd.draw(maskline);
Comments
Post a Comment