Examples

Primative Pong Game
Primative Black Jack Game
Basic OO Black Jack Game
Basic Form
Complex Form
JavaScript from ActionScript
Basic Image Animation
Hello World on a Timer
Tads Basic Checker Class
A Simple FLV Player
Simple getter use
A liaison Class
Parent Child Control
Wrapper to server bridge
Primative Space Shooter Game
Simple XML Loader
Primative Speed Simulation
Simple Sound Mixing
A Simple Gray Button
 


package
{

 import flash.events.MouseEvent;
 import flash.display.Sprite; 



 public class grayButton extends Sprite 
 {

/* The button graphic SWF files below were made using vector creation software.
   Flash CS4 is the best. However, there are many other programs that can be used
   to create vector based swf or png files. There's SwishMax, and DrawPlus to name a few.

   In the drawing program of your choice, a linear gradient is applied to two rounded rectangles.
   Each in the opposite direction, one for the up state and one for the over state.
   In this case, during the down state the alpha of the button decreases.

   This class compiles into a re_useable gray button SWF that can be embedded into other projects.
   It gets used in the JS In ActionScript example and the Shared Objects example.  */

 
  [Embed(source="vectors/greyBupnobor.swf")]
        private var grayButtonUp:Class;

  [Embed(source="vectors/greyBdownnobor.swf")]
        private var grayButtonOver:Class;


  public function grayButton()
  {


	addChild(new grayButtonOver());
	addChild(new grayButtonUp());

	addEventListener(MouseEvent.MOUSE_OVER, overHandler);
	addEventListener(MouseEvent.MOUSE_OUT, outHandler);
	addEventListener(MouseEvent.MOUSE_DOWN, downHandler);
	addEventListener(MouseEvent.MOUSE_UP, upHandler);

	buttonMode = true;
	useHandCursor = true;


  }


  private function overHandler(e:MouseEvent):void 
  {

	getChildAt(0).alpha = 1;
	getChildAt(1).alpha = 1;
	getChildAt(0).visible = true;
	getChildAt(1).visible = false;

  }

  private function outHandler(e:MouseEvent):void 
  {

	getChildAt(0).alpha = 1;
	getChildAt(1).alpha = 1;
	getChildAt(0).visible = false;
	getChildAt(1).visible = true;

  }


  private function downHandler(e:MouseEvent):void 
  {

	getChildAt(0).alpha = .7;
	getChildAt(1).alpha = .7;

  }

  private function upHandler(e:MouseEvent):void 
  {

	getChildAt(0).alpha = 1;
	getChildAt(1).alpha = 1;
	getChildAt(0).visible = false;
	getChildAt(1).visible = true;

  }


 
 }
}

Compiled Result: