package AS{ import flash.display.*; import flash.events.*; import AS.Main; import caurina.transitions.Tweener; public class Button_1 extends MovieClip { //elke class moet een function hebben die het zelfde heet als de class as public function Button_1():void { trace("ButonLinks class werkts"); this.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler); this.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler); this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); } public function mouseOverHandler(e:MouseEvent):void { //trace("over"); Tweener.addTween(this, {x:45, time:0.3, transition:"easeInOutSine"}); } public function mouseOutHandler(e:MouseEvent):void { //trace("weg") Tweener.addTween(this, {x:34.5, time:0.2, transition:"easeInOutSine"}); } public function mouseDownHandler(e:MouseEvent):void { //As.Main.aantal--; //trace(As.Main.aantal); AS.Main.aantal = 1; //trace(As.Main.aantal); AS.Main.refreshPicture(); //stage.b1.alpha = 0 //stage.Tweener.addTween(b1, {alpha:1, time:0.3, transition:"easeinoutquad"}); } } }