-
Notifications
You must be signed in to change notification settings - Fork 0
/
Effector.as
51 lines (43 loc) · 1.24 KB
/
Effector.as
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
package {
import flash.events.Event;
import flash.display.MovieClip;
import effector.BlurEffector;
import effector.SuccessEffector;
import effector.WarnEffector;
public class Effector {
static private var root:MovieClip;
static private var warnEffector:WarnEffector = new WarnEffector()
static private var successEffector:SuccessEffector = new SuccessEffector()
public function Effector() {
}
static public function setRoot(_root:MovieClip){
root = _root
BlurEffector.setRoot(_root);
warnEffector.setRoot(_root);
successEffector.setRoot(_root);
root.addEventListener(Event.ENTER_FRAME,ef)
}
static public function MovieEffect(movie:MovieClip)
{
root.addChild(movie);
}
static public function BlurEffect(next:Function = null){
BlurEffector.BlurEffect(next);
}
static public function BlurOn(){
BlurEffector.BlurOn()
}
static public function BlurOff(){
BlurEffector.BlurOff()
}
static public function WarnEffect(){
warnEffector.go()
}
static public function SuccessEffect(){
successEffector.go()
}
static public function ef(e:Event){
MovieClip(root).filters = [BlurEffector.getFilter()].concat(successEffector.getFilter()).concat(warnEffector.getFilter())
}
}
}