In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

still alive

Get Adobe Flash player
by miyaoka 23 Dec 2008
/**
 * Copyright miyaoka ( http://wonderfl.net/user/miyaoka )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/jOpX
 */

package 
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	[SWF(backgroundColor= 0x000000)]
	
	public class Main
	extends Sprite
	{
		private var cube:Cube;
		public function Main():void 
		{
			addEventListener(Event.ENTER_FRAME, enterFrameHandler);
			
			//make a cube
			cube = new Cube();
			cube.x = stage.stageWidth * 0.5;
			cube.y = stage.stageHeight * 0.5;
			addChild(cube);
			
			//still alive?
			while (GLaDOS.isStillAlive()) GLaDOS.SingsTo(cube);
		}
		private function enterFrameHandler(evt:Event):void 
		{
			cube.rotation -= 0.2;
		}
	}	
}
import flash.display.Sprite
class Cube
extends Sprite
{
	public function listen(word_:String):void 
	{
		trace(word_);
		rotation += 90;
		var word:Word = new Word(word_, 220);
		addChild(word);
		word.rotation = -rotation;
		
		var num:uint = numChildren;
		var i:uint = num;
		
		while (i--) {
			var w:Word = getChildAt(i) as Word;
			w.scaleX = w.scaleY = i / num * 0.7 + 0.3;
		}
	}
}

import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.BitmapData;
import flash.display.Bitmap;
class Word
extends Sprite
{
	public function Word(word_:String, center:Number):void 
	{
		var tf:TextField = new TextField();
		tf.defaultTextFormat = new TextFormat("Arial", 9);  
		tf.textColor = 0xcc9900;  
		tf.autoSize = "left"; 
		tf.text = word_;
		
		var bd:BitmapData = new BitmapData(tf.width,tf.height, true, 0x000000);  
        bd.draw(tf);  
		var bmp:Bitmap = new Bitmap(bd);
		
		var sp:Sprite = new Sprite();
		sp.addChild(bmp);
		addChild(sp);
		bmp.x = bmp.y = -center;
		bmp.height = 32;
		bmp.width = center * 2 - bmp.height;
	}
}


class GLaDOS
{
	public static function isStillAlive():Boolean
	{
		return noteLine < notes.length;
	}
	public static function SingsTo(cube:Cube):void 
	{
		cube.listen(notes[notes.length - 1 - noteLine++] );
	}
	private static var noteLine:uint = 0;
	private static var notes:Array = [
		"Froms FROM-29827281-12:",
		"Test Assessment Report",


		"This was a triumph.",
		"I'm making a note here:",
		"HUGE SUCCESS. It's hard to overstate my satisfaction.",
		"Aperture Science We do what we must because we can.",
		"For the good of all of us. Except the ones who are dead.",


		"But theres no sense crying over every mistake.",
		"You just keep on trying till you run out of cake.",
		"And the Science gets done. And you make a neat gun.",
		"For the people who are still alive.",



		"Froms FROM-55551-5:",
		"Personnel File Addendum:",

		"Dear <<Subject Name Here>>,",


		"I'm not even angry.I'm being so sincere right now.",
		"Even though you broke my heart.",
		"And killed me. And tore me to pieces.",
		"And threw every piece into a fire.",
		"As they burned it hurt because I was so happy for you!",
		"Now these points of data make a beautiful line.",
		"And we're out of beta. We're releasing on time.",
		"So I'm GLaD. I got burned.",
		"Think of all the things we learned for the people who are still alive.",



		"Froms FROM-55551-6:",
		"Personnel File Addendum Addendum:",

		"One last thing:",


		"Go ahead and leave me.",
		"I think I prefer to stay inside.",
		"Maybe you'll find someone else to help you.",
		"Maybe Black Mesa... THAT WAS A JOKE. FAT CHANCE.",
		"Anyway, this cake is great.",
		"It's so delicious and moist.",
		"Look at me still talking when there's Science to do.",
		"When I look out there, it makes me GLaD I'm not you.",
		"I've experiments to run. There is research to be done.",
		"On the people who are still alive.",


		"PS: And believe me I am still alive.",
		"PPS: I'm doing Science and I'm still alive.",
		"PPPS: I feel FANTASTIC and I'm still alive.",


		"FINAL THOUGHT:",
		"While you're dying I'll be still alive",


		"FINAL THOUGHT PS:",
		"And when you're dead I will be still alive",


		"STILL ALIVE"
	];
}