tests: Add stage_properties2 test

This commit is contained in:
Kamil Jarosz 2024-04-23 12:22:02 +02:00 committed by Nathan Adams
parent 83d5d18a20
commit 9bc5735d0d
4 changed files with 46 additions and 0 deletions

View File

@ -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);
}
}
}
}

View File

@ -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.

View File

@ -0,0 +1 @@
num_ticks = 1