[Laszlo-dev] attribute 'type' on LzDataset in swf9

P T Withington ptw at openlaszlo.org
Tue Mar 18 05:26:09 PDT 2008


This is what my gigantic patch r8293 in trunk is meant to solve.  When  
Henry thinks we are ready, we need to integrate from trunk and try  
again.

What this boils down to is that the `ondata` spec is creating a  
handler method which needs to be declared at compile time, but right  
now is trying to be added at run time.

Right now, it may be that the work-around is to make LzDataset a  
dynamic class, so that it will permit you to add properties.  That  
should be ok, as long as you are not trying to add a method that makes  
super calls.

On 2008-03-14, at 14:59 EDT, Philip Romanik wrote:

> Hi Tucker,
>
> I just came across this error again when the code is trying to add a  
> property for an event handler.
>
> <canvas width="800" height="800">
>
>  <dataset name="myData" src="http://..."
>       ondata="trace('got data ' + this.serialize())"
>       type="http"/>
>
>  <handler name="oninit">
>    myData.doRequest();
>  </handler>
>
> </canvas>
>
>
>
>
> ReferenceError: Error #1056: Cannot create property $lzc 
> $handle_ondata$$data$2D6$2Elzx_8_21_$m2 on .LzDataset.
>        at LFCNode/addProperty()[C:\Documents and Settings\Philip 
> \Local Settings\Temp\lzswf9\lzgen64999\LFCNode.as:6]
>        at LFCNode/__LZapplyArgs()[C:\Documents and Settings\Philip 
> \Local Settings\Temp\lzswf9\lzgen64999\LFCNode.as:286]
>        at LFCNode()[C:\Documents and Settings\Philip\Local Settings 
> \Temp\lzswf9\lzgen64999\LFCNode.as:80]
>        at $lzsc$mixin$LzDataNodeMixin$LFCNode()[C:\Documents and  
> Settings\Philip\Local Settings\Temp\lzswf9\lzgen64999\$lzsc$mixin 
> $LzDataNodeMixin$LFCNode.as:74]
>        at $lzsc$mixin$LzDataElementMixin$LzDataNodeMixin$LFCNode()[C: 
> \Documents and Settings\Philip\Local Settings\Temp\lzswf9\lzgen64999\ 
> $lzsc$mixin$LzDataElementMixin$LzDataNodeMixin$LFCNode.as:272]
>        at LzDataset()[C:\Documents and Settings\Philip\Local Settings 
> \Temp\lzswf9\lzgen64999\LzDataset.as:6]
>        at LFCNode/makeChild()[C:\Documents and Settings\Philip\Local  
> Settings\Temp\lzswf9\lzgen64999\LFCNode.as:417]
>        at LzInstantiatorClass/makeSomeViews()[C:\Documents and  
> Settings\Philip\Local Settings\Temp 
> \lzswf9\lzgen64999\LzInstantiatorClass.as:100]
>        at LzInstantiatorClass/checkQ()[C:\Documents and Settings 
> \Philip\Local Settings\Temp\lzswf9\lzgen64999\LzInstantiatorClass.as: 
> 73]
>        at LzEvent/sendEvent()[C:\Documents and Settings\Philip\Local  
> Settings\Temp\lzswf9\lzgen64999\LzEvent.as:48]
>        at LFCApplication/__idleupdate()[C:\Documents and Settings 
> \Philip\Local Settings\Temp\lzswf9\lzgen64999\LFCApplication.as:205]
>        at LzIdleKernel$/__update()[C:\Documents and Settings\Philip 
> \Local Settings\Temp\lzswf9\lzgen64999\LzIdleKernel.as:26]
>        at Function/http://adobe.com/AS3/2006/builtin::apply()
>        at <anonymous>()
>        at SetIntervalTimer/onTimer()
>        at flash.utils::Timer/_timerDispatch()
>        at flash.utils::Timer/tick()
>
>
> Any ideas on the cause of this error?
>
> Thanks!
>
> Phil
>
>
>
>> Yeah, sound like you just need to had the var declaration to me.
>>
>> On 2008-03-12, at 13:28 EDT, Philip Romanik wrote:
>>
>> > Hi Tucker,
>> >
>> > There is no setter for 'type' in LzDataset. Without it, swf9  
>> gives a
>> > runtime error when it is specified, ie:
>> >
>> >  <dataset name="myData" type="http" src="data.xml"/>
>> >
>> > The error generated is:
>> >
>> > ReferenceError: Error #1056: Cannot create property type on
>> > .LzDataset.
>> >
>> > This comes from LzNode.__LZapplyArgs -> LzNode.addProperty
>> >
>> > This error goes away by adding a setter. It also went away if I  
>> just
>> > added,
>> >
>> >     var type = null;
>> >
>> > to LzDataset.
>> >
>> >
>> > Thanks!
>> >
>> > Phil
>> >
>



More information about the Laszlo-dev mailing list