-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathController.as
More file actions
76 lines (71 loc) · 1.51 KB
/
Controller.as
File metadata and controls
76 lines (71 loc) · 1.51 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package
{
// adobe
import flash.display.Sprite
//
// own
import com.kiko.display.*;
import com.kiko.text.*;
//
public class Controller extends Sprite
{
//
//
//
public function Controller():void{
createRectTest();
createToggleButtonTest();
}
// done
private function createRectTest():void {
var rect:Rect = new Rect(100, 100, 0xff00aa);
addChild(rect);
rect.x = 200;
rect.y = 200;
trace("");
}
// todo
private function createCustomTextfield():void{
var tf:CustomTextField = new CustomTextField();
addChild(tf);
tf.text = "test text";
tf.appendText("more text");
}
// todo
private function createToggleButtonTest():void{
var tb:ToggleButton = new ToggleButton("Name");
addChild(tb);
// functions
tb.toggle();
tb.toggleOn();
tb.toggleOff();
// events
tb.addEventListener(MouseEvent.TOGGLE_OFF, onToggleOf);
tb.addEventListener(MouseEvent.TOGGLE_ON, onToggleOn);
// gettters setters
tb.text = "New Name";
tb.width = 100;
tb.height = 50;
if(tb.on){}
if(tb.off){}
}
// todo
private static function Math2():void{
function radToDeg(rad:Number):Number{
return rad*180/Math.PI;
}
function degToRad(deg:Number):Number{
return deg/180*Math.PI;
}
function random(min:Number = 0, max:Number = 1):Number{
return Math.random()*(min + max) -max;
}
}
// todo
private function keyboardKeys() {
}
// todo
private function selfRemovingEventListeners() {
}
}//end-class
}//end-pack