Dear,laszlo-user
      Dear all, I want to let the timer more easier to use, so I just create a 
Class for it, but it's still do not reach my mind.The class is like this:
<!-- ******************************************************** -->
<!-- ******************* The Chart: Timer ******************* -->
        <class name = "tt_timer" extends="node">
                <!-- Could the Timer work or not -->    
                <attribute name = "timeSet" type="boolean" value='false'/>
                
                <!-- Cool Down Time in Millisecond -->
                <attribute name = "cooldown" value = "1000"/>
                
                <!-- Method of the Timer: OnInIt -->
                <method event = "oninit" reference="parent">
                        <![CDATA[
                                if (this.timeSet){
                                        this.dGate = new LzDelegate(this, 
"onCoolDown");
                                        LzTimer.addTimer(this.dGate, 
this.cooldown);
                                }
                        ]]>
                </method>
                
                <!-- Method of the Timer: OnCoolDown -->
                <method name = "onCoolDown">
                        <![CDATA[
                                if (this.timeSet){
                                        this.timerOnTime.sendevent();   
//timerOnTime is the event of the parent
                                        LzTimer.addTimer(this.dGate, 
this.cooldown);
                                }
                        ]]>
                </method>
                
        </class>
<!-- ***************** The Chart: Timer END ***************** -->
<!-- ******************************************************** -->
And the Source Code in Canvas just like this:
<tt_timer name = "ttimer" timeSet = "true" cooldown = "400"/>
<method event = "timerOnTime" reference = "ttimer">
...
</method>

Do you all have any suggestion about this? I want it's more graceful.
If I just make the change of the reference of the method in class to "this" or 
keep it NULL, will the event timerOnTime call the method? How can I set with 
the class for any event there?

Best Regards!
And have a nice day!
Zeal

                                

        eealzhang(��亮=研�l)
[EMAIL PROTECTED]
          2005-11-16

Attachment: fox.gif
Description: GIF image

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to