-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMEClip.as
More file actions
40 lines (37 loc) · 1.06 KB
/
MEClip.as
File metadata and controls
40 lines (37 loc) · 1.06 KB
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
// *************************
// * COPYRIGHT
// * DEVELOPER: MTEAM ( info@mteamapp.com )
// * ALL RIGHTS RESERVED FOR MTEAM
// * YOU CAN'T USE THIS CODE IN ANY OTHER SOFTWARE FOR ANY PURPOSE
// * YOU CAN'T SHARE THIS CODE
// *************************
package {
import flash.display.MovieClip;
public class MEClip extends MovieClip
{
private var Listeners:Array = new Array();
private var Func:Array = new Array();
public function MEClip(){
}
public function MEListener(yourEvent,yourFunction:Function){
Listeners.push(yourEvent)
Func.push(yourFunction)
this.addEventListener(yourEvent,yourFunction)
}
public function MERemoveThis(){
for(var i=0;i<Listeners.length;i++){
if(this.hasEventListener(Listeners[i])){
this.removeEventListener(Listeners[i],Func[i])
}
this.parent.removeChild(this)
}
}
public function MERemoveListener(yourListener){
for(var i=0;i<Listeners.length;i++){
if(Listeners[i]==yourListener&&this.hasEventListener(Listeners[i])){
this.removeEventListener(Listeners[i],Func[i])
}
}
}
}
}