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

Sarah Allen sallen at laszlosystems.com
Wed Dec 31 09:30:14 PST 2008


The a/v extensions are written this way (I didn't write them).  Their 
setters aren't being called which make the test files not work.  I was 
trying to isolate why the setter wasn't called, so I wrote that test 
file.  Max worked around the bug we were seeing this morning in the 
change I approved earlier.  We figured the best thing is to refactor all 
of the a/v extensions with LZX syntax as they used to be. 

Is there anywhere else that private internal protocol is used? If so, 
there may be other bugs as a result of those changes.

Thanks,
Sarah

P T Withington wrote:
> The private internal protocol for translating an LZX class to a JS 
> class has changed (to accomodate the new runtimes).  Your test case is 
> out of date.
>
> Is there some compelling reason that you are not just writing your 
> class as a class?  That would avoid a lot of trouble.
>
> On 2008-12-31, at 10:13EST, Sarah Allen wrote:
>
>> 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