updated test data

This commit is contained in:
Jindra Petk
2013-06-29 17:36:05 +02:00
parent a74c5ab225
commit c2971e6ebb
15 changed files with 189 additions and 39 deletions

17
trunk/testdata/as2/Box.as vendored Normal file
View File

@@ -0,0 +1,17 @@
class Box extends MovieClip{
// declare class members
var box_mc:MovieClip;
// Constructor that takes mc as argument
public function Box(passed_mc:MovieClip){
// assign passed mc to our class member
box_mc = passed_mc;
}
// Methods
public function moveUp(){
box_mc._y -= 1;
}
public function moveDown(){
box_mc._y += 20;
}
}

12
trunk/testdata/as2/Cox.as vendored Normal file
View File

@@ -0,0 +1,12 @@
class Cox extends Box{
public function Cox(passed_mc:MovieClip){
super(passed_mc);
}
// Methods
public function testPublic(){
trace("pub");
}
private function testPrivate(){
trace("priv");
}
}

29
trunk/testdata/as2/Enemy.as vendored Normal file
View File

@@ -0,0 +1,29 @@
class Enemy implements Moving {
var x:Number;
var tst:Number = 5;
var tst2:Number;
// constructor
function Enemy(px:Number) {
var k=57;
k=k*27;
var c=k;
x = px+c;
}
function moveLeft(lx:Number) {
x -= lx;
tst=7;
//hovno="bagr";
trace("moveLeft = " + x);
}
function moveRight(rx:Number) {
x += rx;
trace("moveRight = " + x);
}
function moveUp(uy:Number) {
// leave it empty , dont need it
// but must implement it.
}
function moveDown(dy:Number) {
}
}

6
trunk/testdata/as2/Moving.as vendored Normal file
View File

@@ -0,0 +1,6 @@
interface Moving extends Moving2{
function moveUp(py:Number);
function moveDown(py:Number);
function moveLeft(px:Number);
function moveRight(px:Number);
}

6
trunk/testdata/as2/Moving2.as vendored Normal file
View File

@@ -0,0 +1,6 @@
interface Moving2
{
function moveUp(py:Number);
function moveDown(py:Number);
function moveLeft(px:Number);
}

21
trunk/testdata/as2/Ship.as vendored Normal file
View File

@@ -0,0 +1,21 @@
class Ship implements Moving{
var y;
// constructor
function Ship(py:Number){
y = py;
}
function moveUp(uy:Number){
y *= uy;
trace("moveUp = "+y);
}
function moveDown(dy:Number){
y *= dy;
trace("moveDown = "+y);
}
function moveLeft(lx:Number){
// empty
}
function moveRight(rx:Number){
// empty
}
}

Binary file not shown.

Binary file not shown.

15
trunk/testdata/as2/com/jpexs/MyTest.as vendored Normal file
View File

@@ -0,0 +1,15 @@
class com.jpexs.MyTest {
private var i:Number=5;
static var k:Number=27;
function test():Number
{
trace("hello");
return 5;
}
static function testS():Number
{
trace("hi");
return 88;
}
}

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>TestMovie</title>
<title>as3</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color: #ffffff;}
@@ -11,8 +11,8 @@
</head>
<body>
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="TestMovie" align="middle">
<param name="movie" value="TestMovie.swf" />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="as3" align="middle">
<param name="movie" value="as3.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
@@ -24,8 +24,8 @@
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="TestMovie.swf" width="550" height="400">
<param name="movie" value="TestMovie.swf" />
<object type="application/x-shockwave-flash" data="as3.swf" width="550" height="400">
<param name="movie" value="as3.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />

View File

@@ -3,6 +3,7 @@
import flash.utils.Dictionary;
import classes.myInternal;
import flash.errors.EOFError;
public class Test
{
@@ -793,5 +794,49 @@
traceIt("hello"+(k-1));
traceIt("hello"+5+6);
}
}
public function testWhileTry() {
while(true)
{
try
{
while(true)
{
trace("a")
}
}
catch(e:EOFError)
{
continue;
}
catch(e:Error)
{
continue;
}
}
}
public function testWhileTry2() {
for(var i=0;i<100;i++)
{
try
{
for(var j=0;j<20;j++)
{
trace("a")
}
}
catch(e:EOFError)
{
continue;
}
catch(e:Error)
{
continue;
}
trace("after_try");
}
trace("end");
}
}
}

View File

@@ -1,4 +1,4 @@
package classes
package classes
{
public dynamic class TestClass2
@@ -16,5 +16,5 @@ package classes
{
return new TestClass2(a1);
}
}
}
}
}

View File

@@ -1,10 +1,6 @@
package classes
{
import flash.utils.ByteArray;
import flash.utils.Dictionary;
import com.hurlant.math.BigInteger;
import flash.filters.ColorMatrixFilter;
import com.wirelust.as3zlib.Inflate;
public class TestClass3
{
@@ -43,33 +39,36 @@
private static var svgxml:Class;
[Embed(source="text.txt",
mimeType="application/octet-stream")]
mimeType="application/octet-stream")]
private static var txt:Class;*/
/*var c = [1, 2, 3, 4, 5];
var b = 1;
trace("++arr");
b = ++c[2];
trace("arr++");
b = c[2]++;
trace("--arr");
b = --c[2];
trace("arr--");
b = c[2]--;*/
public function testIncDec()
/*public function testContinueLevels()
{
var a = 5;
var b = 0;
trace("++var");
b = ++a;
trace("var++");
b = a++;
trace("--var");
b = --a;
trace("var--");
b = a--;
}
loop182: for (var c = 0; c < 8; c = c + 1)
{
loop165: for (var d = 0; d < 25; d++)
{
for (var e = 0; e < 50; e++)
{
if (e == 9)
{
break loop165;
}
if (e == 20)
{
continue loop182;
}
if (e == 8)
{
break;
}
break loop182;
}
}
trace("hello");
}
}*/
}
}