big merge from master, fix rpm creation, drop fetching swfdec
[gnash.git] / testsuite / misc-ming.all / StageConfigTest.as
blobd75618f2bdd1908c60d7c3d535cd6da4c025685b
1 // makeswf -o StageConfigTest.swf -s 512x512 StageConfigTest.as
2 //
3 // Test for stage configuration. Meant for manual testing, will need
4 // to be turned into a self-contained test (volunteers?)
5 //
7 createEmptyMovieClip("s", 1);
8 with (s)
10 x=2;
12 lineStyle(0, 0);
13 moveTo(0*x, 0*x);
14 lineTo(256*x,256*x);
15 lineTo(256*x,0*x);
16 lineTo(0*x, 256*x);
17 lineTo(0*x, 0*x);
20 s.createEmptyMovieClip("h", 1);
21 with(s.h)
23 lineStyle(0, 0);
24 beginFill(0xffffff, 256);
25 moveTo(256-10, 256-10);
26 lineTo(256+10, 256-10);
27 lineTo(256+10, 256+10);
28 lineTo(256-10, 256+10);
29 moveTo(256-10, 256-10);
31 s.h.onRollOver = function() {};
33 createTextField("tf", 99, 256-100, 0, 200, 50);
34 tf.border = false;
35 tf.autoSize = "center";
37 createTextField("atf", 98, 10, 130, 100, 50);
38 atf.text = "Align: " + Stage.align;
40 createTextField("stf", 97, 10, 150, 200, 50);
41 stf.text = "Scale mode: " + Stage.scaleMode;
43 createTextField("ss", 96, 10, 170, 200, 50);
44 function updateStageSizeReport()
46 ss.text = "Stage size: "+Stage.width+"x"+Stage.height;
48 updateStageSizeReport();
50 onMouseMove = function()
52 s = "Mouse coords:"+_xmouse+"x"+_ymouse;
53 updateStageSizeReport();
54 tf.text = s;
57 scaleModeValues = ['showAll','noScale','exactFit','noBorder'];
58 scaleModeValue=0;
59 onKeyDown = function()
61 var ascii = Key.getAscii();
62 var char = String.fromCharCode(ascii);
64 if ( char == 's' )
66 scaleModeValue=(scaleModeValue+1)%scaleModeValues.length;
67 Stage.scaleMode = scaleModeValues[scaleModeValue];
68 trace("scaleMode:"+Stage.scaleMode);
70 else if (char == 'c')
72 Stage.align = "";
73 r=b=t=l=false;
75 else
77 if (char == "r") { r = !r; }
78 if (char == "b") { b = !b; }
79 if (char == "t") { t = !t; }
80 if (char == "l") { l = !l; }
82 al = r ? "r" : "";
83 al += b ? "b" : "";
84 al += l ? "l" : "";
85 al += t ? "t" : "";
87 trace("align = "+al);
88 Stage.align = al;
91 atf.text="Align: " + Stage.align;
92 stf.text = "Scale mode: " + Stage.scaleMode;
94 // update mouse too
95 s = _xmouse+"x"+_ymouse;
96 tf.text = s;
98 updateStageSizeReport();
101 Key.addListener(this);
103 onResize = function()
105 trace("Resize event received, args to handler: "+arguments.length+" Stage.width="+Stage.width+", Stage.height="+Stage.height);
106 updateStageSizeReport();
108 Stage.addListener(this);