bplist00_WebMainResource_WebSubresources ^WebResourceURL_WebResourceTextEncodingName_WebResourceMIMEType_WebResourceData_WebResourceFrameName_Chttp://localhost:8080/trunk-doc4/docs/reference/LzTimerService.htmlUUTF-8Ytext/htmlO[(
lz.Timer is the single instance of the class
LzTimerService.
lz.Timer is used to invoke functionality after a specific amount of time. By using a <handler> to refer to a particular method, and then by adding a timer to that delegate, the developer can control the timing of the method's start. Use lz.Timer to tweak sequence and timing of visual animations, delay the effects of user events, or implement user experiences with expiration features.
It should be noted that the time passed to the lz.Timer service describes the time before which the delegate may not run -- it is not guaranteed that the delegate will run at that time. Depending on application needs and client performance, the specified delegate may be invoked at any time after the amount of time specified.
The following example displays some text when a button is clicked, and uses lz.Timer to fade the text away after three seconds.
Example 30. Using lz.Timer to invoke method
<canvas height="50">
<button text="Show then Fade" onclick="canvas.showText()"/>
<text name="myText" opacity="0.0" bgcolor="#CCCCCC">The Invisible Man</text>
<simplelayout axis="y" spacing="10"/>
<method name="showText">
myText.setAttribute( "opacity", 1.0 );
lz.Timer.addTimer( new LzDelegate( this, "fadeText" ), 3000 );
</method>
<method name="fadeText">
myText.animate( "opacity", 0.0, 1000 );
</method>
</canvas>
| Name | Type (tag) | Type (js) | Default | Category |
|---|---|---|---|---|
LzTimer
|
lz.TimerService | readonly | ||
The timer service. Also available as the global
lz.Timer.
|
||||
Methods
| addTimer() |
|---|
| Parameter Name | Type | Description |
|---|---|---|
| d | lz.Delegate | The delegate to call when the timer expires |
| millisecs | Number | The number of millisecondss to wait before calling the delegate. |
| countTimers() |
|---|
| removeTimer() |
|---|
| Parameter Name | Type | Description |
|---|---|---|
| d | lz.Delegate | The delegate called by the timer to be removed. If there are multiple timerList entries that call delegate d, removes the first in the order received. |
| resetTimer() |
|---|
| Parameter Name | Type | Description |
|---|---|---|
| d | lz.Delegate | The delegate whose timer to reset. If there are multiple timers for this delegate, the first one is reset. If this delegate is not found in the timer list, a new timer event is created for it. |
| millisecs | The number of milliseconds to wait before calling the timer. |
Copyright © 2002-2008 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.
Wcontent"_WebResourceResponse_:http://localhost:8080/trunk-doc4/docs/includes/docbook.cssObplist00 X$versionT$topY$archiverX$objects _WebResourceResponse_NSKeyedArchiver&,-345GHIJKLMNOPQRSWXU$null !"#$%V$classR$3R$8S$10S$11R$5R$6R$4R$7R$2R$9R$0R$1 '()$+WNS.base[NS.relative _:http://localhost:8080/trunk-doc4/docs/includes/docbook.css./01X$classesZ$classname12UNSURLXNSObject#Aqn)Y 6789@WNS.keysZNS.objects:;<=>? ABCDEF\Content-TypeVServer^Content-LengthTDateTEtag]Last-ModifiedXtext/css_Apache-Coyote/1.1T6075_Thu, 24 Jul 2008 13:11:48 GMT_W/"6075-1213018329000"_Mon, 09 Jun 2008 13:32:09 GMT./TUUV2_NSMutableDictionary\NSDictionary./YZZ[2_NSHTTPURLResponse]NSURLResponse ) 2 7 : P R d CHQ\_enwy8Qqvz \ Xtext/cssO/* Stylesheet for LZX Documentation */ /* J_LZ_COPYRIGHT_BEGIN ******************************************************* * Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. * * Use is subject to license terms. * * J_LZ_COPYRIGHT_END *********************************************************/ @import "styles.css"; div.book, div.chapter, div.part, div.preface, div.appendix, div.index, div.glossary, div.reference { padding-left : 10px; padding-top : 20px; padding-right : 10px; } div.refentry { padding-left : 10px; padding-right : 10px; } div.condition-sidebar{ padding-left : 90px; padding-top : 20px; padding-right : 10px; } .toc .section { font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 12px; font-style: normal; line-height : 18px; font-weight : normal; color: #333399; margin-left : 10px; } .toc dl dd { padding-left : 30px; } h1 { margin-left : 0; } h2 { margin-left: 0; } h3 { margin-left : 0; } td { vertical-align: top; } .rightalign { text-align: right; } .remark { background-color: yellow; } .refsect1 { clear: both; margin-top: 5px; } .refnamediv { margin-top: 20px; margin-bottom: 30px; } .refsynopsisdiv { position: relative; left:60%; max-width: 40%; margin-top: -80px; min-height: 80px; padding: 5pt; text-align: right; } .refsynopsisdiv h2 { margin-left: 0px; font-size: 12px; margin-top: 5px; margin-bottom: 5px; } .refsynopsisdiv { font-style: normal; } .term { font-style: normal; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 13px; font-weight : bold; color: #000000; background-color: #e8e8e8; } .indexdiv dl dd { padding-bottom: inherit; } /* Inline markup */ /* This substitutes for turning on shade.verbatim in parameters.xsl */ pre.programlisting { background-color: #DDDDDD; border: 1px solid #7b839a ; padding: 1em; } em.lineannotation { font-style: italic ; font-weight: normal ; color: inherit; } /* Emphasis inside a program listing is bold blue, instead of italic */ pre em { color: #111499; font-weight: bold; font-style: normal; } code.fieldsynopsis { white-space: normal; } /* This is used in the ECMAScript chapter to mark unsupported APIs */ .strikeout { font-variant: italic; color: red; } /* variablelist */ .variablelist .title { color: white; background-color: #5b607c; } /* Refentry */ .refsect3 { margin-top: 7pt; } .refsect2 h3 { margin-top: 0px; background-color:#DDDDFF; color:#333333; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:13px; font-weight:bold; padding-left: 3px; padding-top: 3px; } .refsect2 { border: 1px solid #7b839a ; margin:5px; } .refsect2 p { padding-left: 3px; padding-right: 3px; } /* Tables */ .refentry .table { table-layout: fixed; width: 100%; } .refentry .table thead { color:#333333; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size: 11px; font-weight:bold; } .refentry .table thead tr { background-color: #e6e6e6; } .refentry td { font-size: 11px; border-bottom-width: 1px; } .refentry .table thead th { background-color: #e6e6e6; font-size: 11px; } .refentry .table .fieldsynopsis { font-size: 12px; line-height:16px; color: purple; } .variablelist table { border-collapse: collapse; } .variablelist tbody td.attrdesc { border-bottom: 1px solid #e6e6e6; } .attrdesc dt .term { font-size: 11px; } .attrdesc dd { line-height: 14px; margin-left: 10px; padding-bottom: 5px; padding-left: 45px; } /* Segmented Lists */ .segmentedlist > .title { margin-top: 7pt; margin-bottom: 5pt; background-color: #5b607c; color: white; } tr.segtitle { background-color: #e6e6e6; text-align: left; } tr.segtitle > th { width: 55px; } /* Synopsis */ .methodclass, .methodstaticclass, .methodname { font-size: 1.08em color: #333333; } .methodname { font-weight:bold; } .classsynopsis, .methodsynopsis, .fieldsynopsis { font-size: 14px; font-family:"Courier New",Courier,monospace; } .classsynopsis .methodsynopsis .fieldsynopsis .varname { font-weight:bold; } .classname { font-weight:bold; color : #646464; background-color : #eaeaea; } .methodsynopsis .parameter { font-style:italic; } /* Conditional Text */ .swf, .swf7, .dhtml, .svg, .jme { border-left: 1px solid #7b839a; border-right: 1px solid #7b839a; border-top: 1px solid #b0b8cf; border-bottom: 1px solid #8E96AD; background-color: #F8F8F8; } .swf:before, .swf7:before, .dhtml:before, .svg:before, .jme:before { content:attr(alt); font-weight:bold; display: block; float: right; text-align: right; margin-right: 5pt; margin-top: 5pt; } /* Live examples */ .example, .informalexample { margin-top: 5pt; margin-bottom: 5pt; border-left: 1px solid #7b839a; border-right: 1px solid #7b839a; border-top: 1px solid #b0b8cf; border-bottom: 1px solid #8E96AD; background-color: #E0E0E0; } .example .title, .informalexample .title { margin-top: 0pt; margin-bottom: 0pt; padding-top: 0pt; padding-bottom: 0pt; padding-left: 10pt; border-bottom: 1pt solid black; background-color: #7b839a; color : #ffffff; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 10px; font-weight: bold; text-decoration: none; } .embedded-canvas { background-color: white; width: 100%; } .example table, .informalexample table { width: 100%; background-color: #E0E0E0; } .example .programlisting, .informalexample .programlisting { margin: 0 0 0 0; padding-top: 10pt; padding-bottom: 10pt; padding-left: 7pt; } .edit-button { padding-left: 7pt; } td { vertical-align:top; } _Chttp://localhost:8080/trunk-doc4/docs/includes/lzx-pretty-print.cssObplist00 X$versionT$topY$archiverX$objects _WebResourceResponse_NSKeyedArchiver&,-345GHIJKLMNOPQRSWXU$null !"#$%V$classR$3R$8S$10S$11R$5R$6R$4R$7R$2R$9R$0R$1 '()$+WNS.base[NS.relative _Chttp://localhost:8080/trunk-doc4/docs/includes/lzx-pretty-print.css./01X$classesZ$classname12UNSURLXNSObject#Aqn)o 6789@WNS.keysZNS.objects:;<=>? ABCDEF\Content-TypeVServer^Content-LengthTDateTEtag]Last-ModifiedXtext/css_Apache-Coyote/1.1T1496_Thu, 24 Jul 2008 13:11:48 GMT_W/"1496-1211121558000"_Sun, 18 May 2008 14:39:18 GMT./TUUV2_NSMutableDictionary\NSDictionary./YZZ[2_NSHTTPURLResponse]NSURLResponse ) 2 7 : P R d LQZehnw!AZz \ O/* * Stylesheet for LPS viewer */ /* J_LZ_COPYRIGHT_BEGIN ******************************************************* * Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. * * Use is subject to license terms. * * J_LZ_COPYRIGHT_END *********************************************************/ .programlisting .code { background-color: inherit } .starttag, .endtag, .sgmltag-element {color: #0000B7} .endtag {color: #0000B7} .attrname, .sgmltag-attribute {color: #8B0D3A} .attrvalue, sgmltag-attvalue {color: #9A3300} .markup {color: #0000B7} .name {color: #9A3300} .lzxpp-co { font-weight: bold; } .lzx-copyright { display: none; } .comment-body {color: gray; } .comment-markup {color: gray; } .constraint-markup {color: gray} .constraint-expression {color: red} .refpurpose { margin-top: 20px; font-style: italic; font-size: 12px; font-weight: normal; } /* Next two styles, .warningheader and .warningheader a, are for the in-progress tag for the OL4.0.5 reference only. After 4.0.5, these can be deleted. [bshine 2007.08.30] Bug LPP-4539. */ .warningheader { padding-top: 10pt; padding-bottom: 10pt; padding-left: 20pt; border-top: 1pt solid red; border-bottom: 1pt solid red; background-color: #FF9999; color : #ffffff; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 15px; text-decoration: none; } .warningheader a { color: #000099; } _Ahttp://localhost:8080/trunk-doc4/lps/includes/embed-compressed.jsObplist00 X$versionT$topY$archiverX$objects _WebResourceResponse_NSKeyedArchiver&,-345GHIJKLMNOPQRSWXU$null !"#$%V$classR$3R$8S$10S$11R$5R$6R$4R$7R$2R$9R$0R$1 '()$+WNS.base[NS.relative _Ahttp://localhost:8080/trunk-doc4/lps/includes/embed-compressed.js./01X$classesZ$classname12UNSURLXNSObject#AqpA 6789@WNS.keysZNS.objects:;<=>? ABCDEF\Content-TypeVServer^Content-LengthTDateTEtag]Last-Modified_text/javascript_Apache-Coyote/1.1U34280_Thu, 24 Jul 2008 13:17:02 GMT_W/"34280-1216903001000"_Thu, 24 Jul 2008 12:36:41 GMT./TUUV2_NSMutableDictionary\NSDictionary./YZZ[2_NSHTTPURLResponse]NSURLResponse ) 2 7 : P R d JOXcflu~#)Ic \ _text/javascriptOvar $dhtml=true;var $as3=false;var $js1=true;var $swf9=false;var $swf7=false;var $profile=false;var $swf8=false;var $runtime="dhtml";var $svg=false;var $as2=false;var $debug=false;var $j2me=false;try{ if(lz){ }} catch(e){ lz={}};lz.embed={options:{},swf:function($1,$2){ if($2==null){ $2=8 };var $3=$1.url;var $4=$3.indexOf("lzr=swf");if($4==-1){ $3+="&lzr=swf8";$4=$3.indexOf("lzr=swf") };$4+=7;var $5=$3.substring($4,$4+1)*1;if(lz.embed.dojo.info.commVersion>$5){ $3=$3.substring(0,$4)+lz.embed.dojo.info.commVersion+$3.substring($4+1,$3.length);$2=lz.embed.dojo.info.commVersion }else{ if(lz.embed.dojo.info.commVersion<=7&&$5>7){ lz.embed.dojo.info.commVersion=8 }};if($5>$2){ $2=$5 };var $6=this.__getqueryurl($3);if($1.accessible=="true"){ $6.flashvars+="&accessible=true" };if($1.bgcolor!=null){ $6.flashvars+="&bgcolor="+escape($1.bgcolor) };$6.flashvars+="&width="+escape($1.width);$6.flashvars+="&height="+escape($1.height);$6.flashvars+="&__lzurl="+escape($3);$6.flashvars+="&__lzminimumversion="+escape($2);$6.flashvars+="&id="+escape($1.id);var $3=$6.url+"?"+$6.query;var $7={width:$1.width+"",height:$1.height+"",id:$1.id,bgcolor:$1.bgcolor,wmode:$1.wmode,flashvars:$6.flashvars,flash6:$3,flash8:$3,appenddiv:lz.embed._getAppendDiv($1.id,$1.appenddivid)};if(lz.embed[$1.id]){ alert("Warning: an app with the id: "+$1.id+" already exists.") };var $8=lz.embed[$1.id]=lz.embed.applications[$1.id]={runtime:"swf",_id:$1.id,setCanvasAttribute:lz.embed._setCanvasAttributeSWF,getCanvasAttribute:lz.embed._getCanvasAttributeSWF,callMethod:lz.embed._callMethodSWF,_ready:lz.embed._ready,_onload:[],_getSWFDiv:lz.embed._getSWFDiv,loaded:false,_sendMouseWheel:lz.embed._sendMouseWheel,_setCanvasAttributeDequeue:lz.embed._setCanvasAttributeDequeue};if($1.history!=false){ $8._onload.push(lz.embed.history.init) };lz.embed.dojo.addLoadedListener(lz.embed._loaded,$8);lz.embed.dojo.setSwf($7,$2);if($1.cancelmousewheel!=true&&(lz.embed.browser.OS=="Mac"||($7.wmode=="transparent"||$7.wmode=="opaque")&&lz.embed.browser.OS=="Windows"&&(lz.embed.browser.isOpera||lz.embed.browser.isFirefox))){ if(lz.embed["mousewheel"]){ lz.embed.mousewheel.setCallback($8,"_sendMouseWheel") }}},lfc:function($1,$2){ if(!$2||typeof $2!="string"||$2==""){ alert("WARNING: lz.embed.lfc() requires a valid resourceroot to be specified.");return };lz.embed.options.resourceroot=$2;if(lz.embed.browser.isIE){ var $3=$2+"lps/includes/excanvas.js";this.__dhtmlLoadScript($3) };if(lz.embed.browser.isIE&&lz.embed.browser.version<7||lz.embed.browser.isSafari&&lz.embed.browser.version<=419.3){ var $4=$1.indexOf("debug.js")||$1.indexOf("backtrace.js");if($4!=-1){ var $5=$1.substring($4,$1.length-3);$1=$1.substring(0,$4)+$5+"-simple.js" }};this.__dhtmlLoadScript($1) },dhtml:function($1){ var $2=this.__getqueryurl($1.url,true);var $3=$2.url+"?lzt=object&"+$2.query;lz.embed.__propcache={bgcolor:$1.bgcolor,width:$1.width.indexOf("%")==-1?$1.width+"px":$1.width,height:$1.height.indexOf("%")==-1?$1.height+"px":$1.height,id:$1.id,appenddiv:lz.embed._getAppendDiv($1.id,$1.appenddivid),url:$3,cancelkeyboardcontrol:$1.cancelkeyboardcontrol,resourceroot:$1.resourceroot};if(lz.embed[$1.id]){ alert("Warning: an app with the id: "+$1.id+" already exists.") };var $4=lz.embed[$1.id]=lz.embed.applications[$1.id]={runtime:"dhtml",_id:$1.id,_ready:lz.embed._ready,_onload:[],loaded:false,setCanvasAttribute:lz.embed._setCanvasAttributeDHTML,getCanvasAttribute:lz.embed._getCanvasAttributeDHTML};if($1.history!=false){ $4._onload.push(lz.embed.history.init) };this.__dhtmlLoadScript($3) },applications:{},__dhtmlLoadScript:function($1){ var $2='';document.writeln($2);return $2 },__dhtmlLoadLibrary:function($1){ var $2=document.createElement("script");this.__setAttr($2,"type","text/javascript");this.__setAttr($2,"src",$1);document.getElementsByTagName("head")[0].appendChild($2);return $2 },__getqueryurl:function($1,$2){ var $3=$1.split("?");$1=$3[0];if($3.length==1){ return {url:$1,flashvars:"",query:""}};var $4=this.__parseQuery($3[1]);var $5="";var $6="";var $7=new RegExp("\\+","g");for(var $8 in $4){ if($8==""||$8==null){ continue };var $9=$4[$8];if($8=="lzr"||$8=="lzt"||$8=="krank"||$8=="debug"||$8=="profile"||$8=="lzbacktrace"||$8=="lzdebug"||$8=="lzkrank"||$8=="lzprofile"||$8=="fb"||$8=="sourcelocators"||$8=="_canvas_debug"){ $5+=$8+"="+$9+"&" };if($2){ if(window[$8]==null){ window[$8]=unescape($9.replace($7," ")) }};$6+=$8+"="+$9+"&" };$5=$5.substr(0,$5.length-1);$6=$6.substr(0,$6.length-1);return {url:$1,flashvars:$6,query:$5}},__parseQuery:function($1){ if($1.indexOf("=")==-1){ return };var $2=$1.split("&");var $3={};for(var $4=0;$4<$2.length;$4++){ var $5=$2[$4].split("=");if($5.length==1){ continue };var $6=$5[0];var $7=$5[1];$3[$6]=$7 };return $3 },__setAttr:function($1,$2,$3){ $1.setAttribute($2,$3) },_setCanvasAttributeSWF:function($1,$2,$3){ if(this.loaded&&lz.embed.dojo.comm[this._id]&&lz.embed.dojo.comm[this._id]["callMethod"]){ if($3){ lz.embed.history._store($1,$2) }else{ lz.embed.dojo.comm[this._id].setCanvasAttribute($1,$2+"") }}else{ if(this._setCanvasAttributeQ==null){ this._setCanvasAttributeQ=[[$1,$2,$3]] }else{ this._setCanvasAttributeQ.push([$1,$2,$3]) }}},_setCanvasAttributeDHTML:function($1,$2,$3){ if($3){ lz.embed.history._store($1,$2) }else{ if(canvas){ if(!canvas.__LZdeleted){ var $lzsc$1101313808="$lzc$set_"+$1;if(Function["$lzsc$isa"]?Function.$lzsc$isa(canvas[$lzsc$1101313808]):canvas[$lzsc$1101313808] instanceof Function){ canvas[$lzsc$1101313808]($2) }else{ canvas[$1]=$2;var $lzsc$1488826862=canvas["on"+$1];if(LzEvent["$lzsc$isa"]?LzEvent.$lzsc$isa($lzsc$1488826862):$lzsc$1488826862 instanceof LzEvent){ if($lzsc$1488826862.ready){ $lzsc$1488826862.sendEvent($2) }}}}}}},_loaded:function($1){ if(lz.embed[$1].loaded){ return };if(lz.embed.dojo.info.commVersion==8){ setTimeout('lz.embed["'+$1+'"]._ready.call(lz.embed["'+$1+'"])',100) }else{ lz.embed[$1]._ready.call(lz.embed[$1]) }},_setCanvasAttributeDequeue:function(){ while(this._setCanvasAttributeQ.length>0){ var $1=this._setCanvasAttributeQ.pop();this.setCanvasAttribute($1[0],$1[1],$1[2]) }},_ready:function($1){ this.loaded=true;if(this._setCanvasAttributeQ){ this._setCanvasAttributeDequeue() };if($1){ this.canvas=$1 };for(var $2=0;$2