[Laszlo-dev] ERROR: Attempt to instantiate <foo>, which has not been defined

Sarah Allen sallen at laszlosystems.com
Wed Dec 31 07:13:13 PST 2008


I was trying to isolate a bug where the type setter wasn't being called 
for videoview with the test file below.  The dynamic class/interface 
stuff is new for me.  Can someone tell me what I did wrong?

I get this runtime error in the debugger:
	ERROR: Attempt to instantiate <foo>, which has not been defined

<canvas><interface name="foo" extends="view">       <!--- Protocol 
"rtmp" or "http". Default: http. -->       <attribute name="type" 
value="http" type="string"/></interface><switch>   <when 
runtime="dhtml">       <!-- no support for foo in DHTML runtime --> 
</when>   <otherwise>     <script when="immediate"><![CDATA[       // 
Classes that implement an interface must obey the LZX       // 
tag->class mapping convention       dynamic class $lzc$class_foo extends 
LzView {         // Next two are part of the required LFC tag class 
protocol           static var tagname = 'foo';           static var 
attributes = new LzInheritedHash(LzView.attributes);           static 
var uid = 0;	    function $lzc$class_foo(parent, attrs, children, async) 
{               super(parent, attrs, children, async);           } 
override function init() {               super.init();               if 
(this.debug) {                   if ($debug) Debug.write("foo.init()"); 
}	    }         function $lzc$set_type(newtype) { 
Debug.write("videoview setType", newtype, "old", this['type'], 
"isinited", this.isinited, "stream", this['stream']);               //if 
(newtype == undefined) newtype = 'http';               this.type = 
newtype;               //Debug.write('type', this.type); 
// _setType called before init or stream is define, so tip-toe. 
if (this['stream']) {                   this.stream.setAttribute("type", 
newtype);               }           }       }	     ]]></script> 
</otherwise> </switch><foo/></canvas>


More information about the Laszlo-dev mailing list