For some time now, class names have not been global, but are instead defined in the 'lz' module. Try:

  new lz.myClass ...


On 2008-04-28, at 08:45 EDT, Marc Bachstein wrote:

Hello,

I want to call a <text>-Component by name, which is in a
<gridcolumn>-Component. The compiler gives here an error:

"Debug.evalCarefully("ChangingAttributesInText.lzx" , 7, function () {return
myText;}, this) has no properties"

If the <text>-Component is in a <view>-Component there is no compiler error
and it works fine.

Can anybody tell me, how I can call the <text>-Component here by name?

Here are the source codes:

This works:
-----------------------------------------------------------------
<canvas debug="true" >
        <class name="myClass" extends="view">

                <text name="myText" multiline="false" width="0"/>

                <handler name="oninit">
                        myText.setText("Hello!");
                </handler>                        
        </class>

        <view name="View">
                <handler name="oninit">
                        var A = new myClass(this,{});
                </handler>
        </view>
</canvas>
-----------------------------------------------------------------

Here the compiler gives an error:
-----------------------------------------------------------------
<canvas debug="true" >
        <class name="myClass" extends="gridcolumn">

                <text name="myText" multiline="false" width="0"/>

                <handler name="oninit">
                        myText.setText("Hello!");
                </handler>                        
        </class>

        <view name="View">
                <grid>
                        <handler name="oninit">
                                var A = new myClass(this,{});
                        </handler>
                </grid>                   
        </view>
</canvas>
-----------------------------------------------------------------

Kind Regards,
Marc



Reply via email to