My Portfolio

Choose from the list below to view the subjects of my portfolio. Each subject will display to the right for your amusement.

AS3 Flash Video Player

Flash Ad with Game

Coldfusion CFC OOP

FedExchange Project

Fed Volunteer Signup Form

National IT Repository Documentation

Flash Genie & 8 Ball

Flash Chat

My professional blog:
www.cfcdeveloper.com

Flash Ad with Game


Interactive Flash Advertisment with Game

Created in Flash CS3 using Actionscript 3. Yes it's irritating, it's a barn yard full of animals, but you can shoot them and score points. Images were ripped from the web and edited with Fireworks and imported as .png then used as classes. The sounds are my own recordings using Adobe Soundbooth, notice the human sheep sounds and my gunfire effects. To go a step further, the animals could have been developed as seperate farm animal classes inherited from a parent animal class, the sounds could have been used as classes with a volume or on/off, and there could be a high score goal to take you to a web site or something. But this was a quick example I threw together out of my busy schedule, so here it is ready for enhancements. Given that I can do this in one afternoon, what can I do with a week or two and some proper planning?

*No animals were harmed in the development of this game, only those you shoot yourself.

fla file: flashbarnyard.swf
var score:Number = 0;
score_txt.text = String("Score: " + score);
var bulletHole_mc:Bullethole;
var pig:PigTarget = new PigTarget;
var cow:CowTarget = new CowTarget;
var chicken:ChickenTarget = new ChickenTarget;
var sheep:SheepTarget = new SheepTarget;
var ufo:UfoTarget = new UfoTarget;
var gunShot_snd:Gunshot = new Gunshot;
var gunScope_mc:Scope = new Scope;

var bloodSplat_mc:Bloodsplat = new Bloodsplat;
var ufoSplat_mc:Ufosplat = new Ufosplat;

addChild(ufo);
ufo.x = stage.width/2;
ufo.y = stage.height/2;
addChild(pig);
pig.x = stage.width/2;
pig.y = stage.height/2;
addChild(cow);
cow.x = stage.width/2;
cow.y = stage.height/2;
addChild(chicken);
chicken.x = stage.width/2;
chicken.y = stage.height/2;
addChild(sheep);
sheep.x = stage.width/2;
sheep.y = stage.height/2;

addChild(gunScope_mc);
Mouse.hide();

stage.addEventListener(MouseEvent.MOUSE_MOVE, customCursor);
stage.addEventListener(MouseEvent.MOUSE_DOWN, shootGun);

function customCursor(event:MouseEvent):void {
	gunScope_mc.x = mouseX;
	gunScope_mc.y = mouseY;
}
function shootGun(event:MouseEvent):void {
	gunShot_snd.play();
	var shotX:Number = mouseX;
	var shotY:Number = mouseY;
	bulletHole_mc = new Bullethole();
	addChild(bulletHole_mc);
	bulletHole_mc.x = shotX;
	bulletHole_mc.y = shotY;
	bulletHole_mc.gotoAndPlay(1);
	if(pig.hitTestObject(gunScope_mc)) {
		addChild(bloodSplat_mc);
		bloodSplat_mc.x = shotX;
		bloodSplat_mc.y = shotY;
		bloodSplat_mc.gotoAndPlay(1);
		pig.gotoAndPlay(1);
		addScore(10);
	}else if(cow.hitTestObject(gunScope_mc)){
		addChild(bloodSplat_mc);
		bloodSplat_mc.x = shotX;
		bloodSplat_mc.y = shotY;
		bloodSplat_mc.gotoAndPlay(1);
		cow.gotoAndPlay(1);
		addScore(5);
	}else if(chicken.hitTestObject(gunScope_mc)){
		addChild(bloodSplat_mc);
		bloodSplat_mc.x = shotX;
		bloodSplat_mc.y = shotY;
		bloodSplat_mc.gotoAndPlay(1);
		chicken.gotoAndPlay(1);
		addScore(15);
	}else if(sheep.hitTestObject(gunScope_mc)){
		addChild(bloodSplat_mc);
		bloodSplat_mc.x = shotX;
		bloodSplat_mc.y = shotY;
		bloodSplat_mc.gotoAndPlay(1);
		sheep.gotoAndPlay(1);
		addScore(2);
	}else if(ufo.hitTestObject(gunScope_mc)){
		addChild(ufoSplat_mc);
		ufoSplat_mc.x = shotX;
		ufoSplat_mc.y = shotY;
		ufoSplat_mc.gotoAndPlay(1);
		ufo.gotoAndPlay(1);
		addScore(50);
	}
}
function addScore(points:Number):void {
	score = score + points;
	score_txt.text = String("Score: " + score);
}