Code:
public class countTen
{
public static void main(String[] args) {
System.out.println("1, 2, 3, 4, 5, 6, 7, 8, 9, 10");
}
}
ActionScript using Flixel Engine
countTen.as
Code:
package
{
import org.flixel.FlxGame
[SWF(width="640", height="480", backgroundColor="#000000")]
public class countTen extends FlxGame
{
public function countTen()
{
super(320, 240, countScreen, 2);
}
}
}
countScreen.as
Code:
package
{
import org.flixel.FlxState;
import org.flixel.FlxText;
public class countScreen extends FlxState
{
override public function create():void
{
var i:Number = 10;
var count:Number = 1;
var counter:FlxText;
for(count = 1; count <= 10; count++){
i += 10;
counter = new FlxText(0, FlxG.height - i, FlxG.width, count.toString());
counter.setFormat(null, 8, 0xffffff, "center");
add(counter);
}
}
}
}