PDA

View Full Version : tagname of base classes are not their original classname?


mico
08-04-2008, 11:37 PM
<canvas debug="true">
<button text="immediately">
<method event="onclick">
temp = new lz.borderedbox1(canvas,{});
Debug.write(hahaha.constructor["tagname"]);
Debug.write(hahaha.constructor["classname"]);
Debug.write(this.constructor["tagname"]);
Debug.write(this.constructor["classname"]);
</method>
</button>
<class name="box" height="30" width="30" bgcolor="red"/>
<simplelayout spacing="5"/>
<class name="borderedbox1" extends="box"/>
<borderedbox1 id="hahaha"/>

</canvas>


see this code , i though the button should have a "tagname" with "button"
but found result was

borderedbox1
$lzc$class_borderedbox1
button_$$2Etmp_C697C77B63C2714AA45A51E9F3163AFA_he llo$2Elzx_2_32
$lzc$class_button_$$2Etmp_C697C77B63C2714AA45A51E9 F3163AFA_hello$2Elzx_2_32

runtime swf,ff3,OL4.1.1

senshi
08-05-2008, 12:32 AM
To support swf9-development, all instances with constraints, methods or handlers will be transformed to a temporary class. That's the reason you get this ugly tagname.
For example, if you add an "onclick"-handler to your borderedbox-instance, you'll also get one of these temporary classes:


<canvas debug="true">
<button text="immediately">
<handler name="onclick">
Debug.write(canvas.hahaha.constructor["tagname"]);
Debug.write(canvas.hahaha.constructor["classname"]);
Debug.write(this.constructor["tagname"]);
Debug.write(this.constructor["classname"]);
</handler>
</button>
<class name="box" height="30" width="30" bgcolor="red"/>
<simplelayout spacing="5"/>
<class name="borderedbox1" extends="box"/>
<borderedbox1 name="hahaha" onclick=";"/>
</canvas>

mico
08-05-2008, 02:42 AM
To support swf9-development, all instances with constraints, methods or handlers will be transformed to a temporary class. That's the reason you get this ugly tagname.
For example, if you add an "onclick"-handler to your borderedbox-instance, you'll also get one of these temporary classes:


yes , i understand this , i saw many ugly classname's in JS code:D

what i want to ask is:
does OL does support the original "tagname" in customized instances (constraint and method filled in tag )?
or
it is a defect?

thank you , Andre!

senshi
08-05-2008, 09:46 AM
I've forwarded your question to laszlo-dev (http://www.openlaszlo.org/pipermail/laszlo-dev/2008-August/016607.html).