 
       # console.log 'new node', @, attributes
       @sendEvent('init', @)
+
+    initConstraints: ->
+      _initConstraints()
+      
 
     # generate a callback for an event expression in a way that preserves scope, e.g. on_x="console.log(value, this, ...)"
     eventCallback = (name, script, scope, fnargs=['value']) ->

      @sprite.set_class(classname)


  # a list of constraint scopes gathered at init time
  constraintScopes = []

  dom = do ->
    # flatten element.attributes to a hash

    # initialize an element
    initFromElement = (el) ->
      initElement(el)
      for child of _children
        {name, el, attributes} = child
        console.log name, el, attributes
        parent = new lz[name](el, attributes)
      _children = []

      _initConstraints()


    specialtags = ['handler', 'method', 'attribute', 'setter']
    # recursively init classes based on an existing element
