tests: Add stage_properties2 test
This commit is contained in:
parent
83d5d18a20
commit
9bc5735d0d
|
@ -0,0 +1,37 @@
|
||||||
|
package {
|
||||||
|
import flash.display.Sprite;
|
||||||
|
import flash.display.Stage;
|
||||||
|
|
||||||
|
public class Test extends Sprite {
|
||||||
|
function Test() {
|
||||||
|
super();
|
||||||
|
var stage:Stage = this.stage;
|
||||||
|
trace("===== height");
|
||||||
|
this.logError(function() {
|
||||||
|
trace(stage.height);
|
||||||
|
});
|
||||||
|
this.logError(function() {
|
||||||
|
trace(stage.height = 400);
|
||||||
|
});
|
||||||
|
trace("===== width");
|
||||||
|
this.logError(function() {
|
||||||
|
trace(stage.width);
|
||||||
|
});
|
||||||
|
this.logError(function() {
|
||||||
|
trace(stage.width = 400);
|
||||||
|
});
|
||||||
|
trace("===== textSnapshot");
|
||||||
|
this.logError(function() {
|
||||||
|
trace(stage.textSnapshot);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function logError(f:*):void {
|
||||||
|
try {
|
||||||
|
f();
|
||||||
|
} catch(error) {
|
||||||
|
trace("Error: " + error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
===== height
|
||||||
|
0
|
||||||
|
Error: Error: Error #2071: The Stage class does not implement this property or method.
|
||||||
|
===== width
|
||||||
|
0
|
||||||
|
Error: Error: Error #2071: The Stage class does not implement this property or method.
|
||||||
|
===== textSnapshot
|
||||||
|
Error: Error: Error #2071: The Stage class does not implement this property or method.
|
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
num_ticks = 1
|
Loading…
Reference in New Issue