Login Register

createSurface

Initializing Graphics

Hello, I am trying to draw a few circles inside a surface, however I get an error in firefox's console saying that the surface is null. The line var circleCreate = surface.createCircle(circle) is where the console gives the error. Here is my code:

dojo.require("dojox.gfx.move");
dojo.require("dojox.gfx.utils");
dojo.require("dojo._base.Color");
dojo.require("dojox.gfx._base");
dojo.require("dojox.gfx.shape");
dojo.require("dojox.gfx.path");
dojo.require("dojox.gfx.arc");
dojo.require("dojox.gfx");
dojo.require("dojo.colors");

method for creating gfx.surface

[EDIT: fixed the inline HTML reference.]

I noticed that all of the examples using gfx, create the drawing surface in the same manner, programatically.
That is, they all have a <div id="gfx_here"></div> in the document body and then call a javascript onLoad which calls dojox.gfx.createSurface(...). Is there any other way to create the drawing surface? Would it be possible to enter the contents of a drawing delaritively (in the html document body)?

Syndicate content