Skip to content

Instantly share code, notes, and snippets.

@jhaynie
Created November 25, 2010 07:17
Show Gist options
  • Save jhaynie/715025 to your computer and use it in GitHub Desktop.
Save jhaynie/715025 to your computer and use it in GitHub Desktop.
Prototype of writing a Titanium application using ActionScript 3 natively (instead of JS).
package {
import Titanium.API;
import Titanium.UI;
/**
* Simple Titanium application written in ActionScript 3
*/
public class App
{
public static function main() : void
{
Titanium.API.info("hello");
var win : Window = Titanium.UI.createWindow({
backgroundColor:"red"
});
var button : Button = Titanium.UI.createButton({
width:100,
height:40,
title:"Click me"
});
win.add(button);
win.open();
button.addEventListener("click",function(e){
button.setTitle("Yah!");
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment