Hooman's Portfolio  
 Contact  
 Hootris  
 Dinky Chase  
 Hooman to Eves  
 Eves To Hooman  
Hello World ActionScript 3.0

My First Hello World Program in Flash

Below is the first program I ever wrote in ActionScript. It is a simple demonstration of some of the controls that are already available in the AS3 library.

Click on the button in the upper left corner to see what happens - exciting! The code for this demo is presented at the bottom of the page.


Note: All the graphics in this example are programmatically created at run time. The following is saved as "HelloWorld.as" and added as an object to the flash file.

package {

import flash.display.Sprite;
import flash.text.TextField;
import fl.controls.Button;
import fl.events.ComponentEvent;
import fl.controls.CheckBox;
import fl.controls.List;

public class HelloWorld extends Sprite {

//Code will automatically run here...
public function HelloWorld() : void {

var b : Button = new Button;

b.label = "Click Me!";
addChild(b);
b.addEventListener(ComponentEvent.BUTTON_DOWN, ButtonHandler);

var c : CheckBox = new CheckBox;

c.label = "Click here!";
c.y = 50;
addChild(c);

var l : List = new List;

for (var i : int = 1; i <= 10; i++) {
l.addItem( { label: i.toString() } ); }

l.x = 20;
l.y = 100;
l.rowCount = 8;
addChild(l);
}

private function ButtonHandler(e : ComponentEvent) {

var t : TextField = new TextField;

t.text = "Hello World!";
t.x = 250;
t.y = 250;
addChild(t);
removeEventListener(ComponentEvent.BUTTON_DOWN, ButtonHandler);
}

}

}

Latest Work:

Applications
Content Management System
Local Developer
Manager's Advantage
Manager's Advantage Support

Games • ActionScript 3
Hootris
Dinky Chase (not finished)

Demos • ActionScript 3
Loading and Saving XML
Physics - 2D Collision
Physics - 1D Collision
Scroller
Filters Demo
Transition Demo
Tween Demo
Psychedelic Stage Light
Video Player
Hotdog Guitar
Filters and Gradients
Keyboard Demo
Hello World
Simple Button

Previous Work:

Applications • Turbo Pascal
Map Editor
Master GFX 16
Hooman's File Manager

Games
Stone Bringer
The Original Hootris

Demos • C++ / DirectX
Fish