forked from arpit/openpyro
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestNestedContainers.as
More file actions
98 lines (72 loc) · 2.35 KB
/
TestNestedContainers.as
File metadata and controls
98 lines (72 loc) · 2.35 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package
{
import org.openPyro.aurora.AuroraContainerSkin;
import org.openPyro.core.UIContainer;
import org.openPyro.core.UIControl;
import org.openPyro.layout.HLayout;
import org.openPyro.painters.FillPainter;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.DropShadowFilter;
import net.comcast.logging.Logger;
import net.comcast.logging.consoles.LogBookConsole;
public class TestNestedContainers extends Sprite
{
private var container3:UIContainer
public function TestNestedContainers()
{
stage.scaleMode = "noScale"
stage.align = "TL"
Logger.addConsole(new LogBookConsole('_test'))
Logger.debug(this, "Init")
var container:UIContainer = new UIContainer()
container.name = "c1"
container.width = 200
container.percentUnusedHeight = 100
container.skin = new AuroraContainerSkin()
var red:UIControl = new UIControl()
red.backgroundPainter = new FillPainter(0xff0000)
red.width = 400
red.height = 800
container.addChild(red)
//addChild(container);
//container.validateSize()
var container2:UIContainer = new UIContainer()
container2.name = "c2"
container2.width = 300;
container2.height = 200
container2.skin = new AuroraContainerSkin()
var blue:UIControl = new UIControl()
blue.backgroundPainter = new FillPainter(0x0000ff)
blue.width = 300
blue.height = 400;
container2.addChild(blue)
container3 = new UIContainer()
container3.name = "c3"
container3.skin = new AuroraContainerSkin()
container3.layout = new HLayout(20)
container3.addChild(container)
container3.addChild(container2)
addChild(container3);
container3.width = stage.stageWidth/3
container3.height = stage.stageHeight/3
container3.x = container3.y = 100;
container3.addEventListener(MouseEvent.CLICK, onC3Click);
//container3.filters = [new DropShadowFilter()]
stage.addEventListener(Event.RESIZE, onResize);
}
private function onResize(event:Event):void
{
container3.width = stage.stageWidth/3
container3.height = stage.stageHeight/3
}
private function onC3Click(event:Event):void
{
for(var i:uint=0; i<container3.numChildren; i++)
{
trace("child: "+i+" -> ",container3.getChildAt(i), container3.getChildAt(i).name);
}
}
}
}