-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimerTest.html
53 lines (46 loc) · 1.19 KB
/
TimerTest.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<title>moviecliptest</title>
<script type="text/javascript" src="js/seajs/sea.js"></script>
<script type="text/javascript">
seajs.config({
base:'file:///E:/github/Dream/dream/',
alias:{
},
charset:'utf-8',
timeout:20000,
debug:1
});
seajs.use('core/Dream',function(Dream){
var game=window.game={};
var display=Dream.display;
var utils=Dream.utils;
var events=Dream.events;
var DisplayObject=display.DisplayObject;
var MovieClip=display.MovieClip;
var EventDispatcher=events.EventDispatcher;
var Timer=utils.Timer;
var timer=window.timer=new Timer(200,20);
timer.addEventListener('timer',onTick);
timer.addEventListener('timercomplete',onComplete);
timer.addEventListener('timercomplete',onCom);
timer.start();
function onCom(e){
console.log(e.target);
}
function onTick(e){
console.log(e.target.currentCount);
}
function onComplete(e){
console.log(e.target.currentCount);
}
});
</script>
</head>
<body>
<div id="ctn" style="text-align:left;">
<canvas width="1000" height="600" id="can" style="border:none;"></canvas>
</div>
</body>
</html>