hi folks...hier einscript, dass euch informiert, wenn die maus einen der angemeldeten movieclips berührt bzw. wieder verlässt...
und zwar ohne dass ihr für jeden einen onRollOver definieren müsstet...
|
ActionScript-Quelltext
|
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
|
mouseWatcher = function(){
this.mcArray = [];
this.isActivated = 'no clip';
};
o = mouseWatcher.prototype;
o.addElementsToArray = function(arr){
for(var i in arr) {this.mcArray.push(arr[i]);};
this.activateEvent();
}
o.checkEvent = function(){
var arr = this.mcArray;
for(var i in arr){
var mc = arr[i];
if((mc.hitTest(_root._xmouse, _root._ymouse, true)) &&(this.isActivated == 'no clip')){
trace('Mouse über '+mc);
this.isActivated = mc;
}else if(!this.isActivated.hitTest(_root._xmouse, _root._ymouse, true) && (this.isActivated != 'no clip')){
trace('Mouse nicht mehr über '+this.isActivated);
this.isActivated = 'no clip';
}
}
}
o.activateEvent = function(){
this.onMouseMove = function(){
this.checkEvent();
}
Mouse.addListener(this);
}
delete o;
myEvent= new mouseWatcher();
myEvent.addElementsToArray([mc1, mc2, mc3, mc4, mc5]);
|
greetz
kelor