Thursday, September 9th 2010, 5:07pm UTC+2

You are not logged in.

  • Login
  • Register

kelor

Super Moderator

Posts: 3,408

Location: formel1-stadt hockenheim

1

Monday, July 19th 2004, 9:03pm

Mehrere MovieClips auf Maus überprüfen

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';
};

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._ymousetrue)) &&(this.isActivated == 'no clip')){
              trace('Mouse über '+mc);
              this.isActivated mc;
           }else if(!this.isActivated.hitTest(_root._xmouse_root._ymousetrue) && (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([mc1mc2mc3mc4mc5]);




greetz


kelor
[ActionScript-Trainer] [Referent ActionScript] [Buchautor]
[Online/Offline Flash_Applications & Developer]
  • Go to the top of the page