Posted By

Daxander on 08/02/10


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

davidino1978
tspitzr


AS3: EventListener for multiple movieclips


 / Published in: ActionScript 3
 

  1. chooseMC.addEventListener(MouseEvent.CLICK, chooseBTclick);
  2. chooseMC.addEventListener(MouseEvent.MOUSE_OVER, chooseBTover);
  3. chooseMC.addEventListener(MouseEvent.MOUSE_OUT, chooseBTout);
  4.  
  5. function chooseBTclick(e:MouseEvent):void
  6. {
  7. if (e.target == chooseMC.webBT){
  8.  
  9.  
  10. }
  11. if (e.target == chooseMC.videoBT){
  12.  
  13.  
  14. }
  15. if (e.target == chooseMC.logoBT){
  16.  
  17.  
  18. }
  19.  
  20. }
  21. function chooseBTover(e:MouseEvent):void{
  22. e.target.gotoAndPlay(2);
  23. }
  24. function chooseBTout(e:MouseEvent):void{
  25. e.target.gotoAndPlay(6);
  26. }

Report this snippet  

You need to login to post a comment.