-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathSliderButtonSwitcher.as
More file actions
56 lines (46 loc) · 1.13 KB
/
SliderButtonSwitcher.as
File metadata and controls
56 lines (46 loc) · 1.13 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package sliderMenu
{//sliderMenu.SliderButtonSwitcher
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.MouseEvent;
public class SliderButtonSwitcher extends MovieClip
{
/**Event.OPEN and Event.CLOSE*/
internal static var lockDispatcher:EventDispatcher = new EventDispatcher();
public function SliderButtonSwitcher()
{
super();
lockDispatcher.addEventListener(Event.OPEN,imUnLock);
lockDispatcher.addEventListener(Event.CLOSE,imLock);
this.buttonMode = true ;
this.addEventListener(MouseEvent.CLICK,clicked);
this.visible = !SliderManager.lock_flag ;
this.buttonMode = true ;
}
protected function imUnLock(event:Event):void
{
this.visible = true ;
}
protected function imLock(event:Event):void
{
this.visible = false ;
}
protected function clicked(event:MouseEvent):void
{
if(SliderManager.isOpen())
{
trace("Hide the menu");
SliderManager.hide();
}
else
{
trace("Show the menu");
if(!SliderManager.lock_flag)
{
SliderManager.openMenu();
}
}
}
}
}