-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdropDown2.as
More file actions
31 lines (29 loc) · 970 Bytes
/
dropDown2.as
File metadata and controls
31 lines (29 loc) · 970 Bytes
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
package {
import flash.display.MovieClip;
import flash.events.*;
public class dropDown2 extends MovieClip{
private var _root:*;
private var whichWallRef:int;
public function dropDown2(passedWall:int) {
addEventListener(Event.ADDED,beginClass);
this.b1.addEventListener(MouseEvent.MOUSE_UP, repairWall);
this.b2.addEventListener(MouseEvent.MOUSE_UP, upgradeWall);
this.b3.addEventListener(MouseEvent.MOUSE_UP, xOut);
//this.b4.addEventListener(MouseEvent.MOUSE_UP, destroyThis);
}
private function beginClass(e:Event):void {
_root = MovieClip(root);//setting the root
}
private function repairWall(Event:MouseEvent):void{
//_root.wallAndTowerObjectData[whichWallRef].doRepair(false);
xOut();
}
private function upgradeWall(Event:MouseEvent):void{
trace("open upgrade");
xOut();
}
private function xOut(Event:MouseEvent = null):void{
this.parent.removeChild(this);
}
}
}