codecamp

E4A时钟

•关于E4A时钟

    时钟是E4A的一个官方类库,作用是在程序代码里用来延时,属于不可视类库。

•时钟的创建

    关于怎么在程序里创建类库,这个基础教程有,我就不再讲了。


•时钟的代码结构

下图为时钟延期代码结构:



•时钟的应用-启动页

    有时候程序启动代码太多,会黑屏几秒,这时候我们可以插个启动页,并让它几秒后自动关掉。写法和代码如下:

先创建一个图片框:


写如下代码:


就时钟而言,我们有很多用途,大家需要的话自己研究吧。

在E4A插入多媒体信息
E4A浏览器
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }