Search code examples
actionscript-3canvasstarling-framework

Error #3671: Buffer has zero size


I wonder why I got this error on another canvas? While I was using larger canvas for another object, it doesn't has any problem. But on another object, I got this error and the numVertices is null or 0.

It happen when I lock the screen then unlock it back. Like on desktop is ctrl + alt + del and on device is press the lock button.

I am using starling Framwork Ver 1.7 the newest on Github, flex SDK ver 4.6.0, and AIR 18.0

Here where I got the error :

flash.display3D::Context3D/createVertexBuffer  
starling.display::Canvas/syncBuffers at D:\Project\starling 1.7src\starling\display\Canvas.as:237
starling.display::Canvas/onContextCreated at D:\Project\starling 1.7src\starling\display\Canvas.as:71  
starling.events::EventDispatcher/invokeEvent at D:\Project\starling 1.7 src\starling\events\EventDispatcher.as:146  
starling.events::EventDispatcher/dispatchEvent at D:\Project\starling 1.7 src\starling\events\EventDispatcher.as:117  
starling.events::EventDispatcher/dispatchEventWith at D:\Project\starling 1.7 src\starling\events\EventDispatcher.as:195  
starling.core::Starling/initializeGraphicsAPI at D:\Project\starling 1.7 src\starling\core\Starling.as:451  
starling.core::Starling/initialize at D:\Project\starling 1.7 src\starling\core\Starling.as:434  
starling.core::Starling/onContextCreated at D:\Project\starling 1.7 src\starling\core\Starling.as:691

Solution

  • maybe my canvas has zero width and height. because i just initialize it and haven't use yet. i just add this command and all done.

    myCanvas.drawRectangle(0,0,1,1);
    

    so my canvas has width and height. you can also try another draw, like polygon, circle or ellipse.