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

forked from: Version Check for Flash Player 10.1

/**
 * Copyright bkzen ( http://wonderfl.net/user/bkzen )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/otAq
 */

// forked from clockmaker's Version Check for Flash Player 10.1
package 
{
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.navigateToURL;
	import flash.net.URLRequest;
	import flash.system.Capabilities;
	import flash.system.LoaderContext;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import net.wonderfl.widget.Wanco;
	import com.bit101.components.*;
	import net.hires.debug.Stats;
	
	public class Main extends Sprite 
	{
		public function Main():void 
		{
			var version:Array = Capabilities.version.split(" ")[1].split(",");
			var major:int = int(version[0]);
			var minor:int = int(version[1]);
			var build:int = int(version[2]);
			
			var tf:TextField = new TextField();
			tf.defaultTextFormat = new TextFormat("Arial", 16, null, true, null, null, null, null, "center");
			tf.autoSize = TextFieldAutoSize.CENTER;
			addChild(tf);
			
			if (major >= 10 && minor >= 1)
			{
				tf.text = "Your Version is [" + Capabilities.version + "]\nGood!";
				
				var loader:Loader = new Loader();
				loader.load(new URLRequest('http://www.project-nya.jp/images/flash/chick.swf'), new LoaderContext(true));
				addChild(loader);
				
				loader.x = stage.stageWidth / 2 >> 0;
				loader.y = stage.stageHeight / 2 >> 0;
			}
			else
			{
				tf.text = "Your Version is [" + Capabilities.version + "]\nPlease Get Flash Player 10.1";
				new PushButton( this, stage.stageWidth / 2 - 60, stage.stageHeight/2 + 100, "Get Flash Player 10.1", function(e:*):void {
					navigateToURL(new URLRequest("http://get.adobe.com/flashplayer/"), "_blank");
				});
				
				
				var wanco:Wanco = new Wanco();
				addChild(wanco);
				
				wanco.x = stage.stageWidth / 2 >> 0;
				wanco.y = stage.stageHeight / 2 >> 0;
			}
			
			tf.x = (stage.stageWidth - tf.textWidth) / 2 >> 0;
			tf.y = stage.stageHeight / 2 + 50 >> 0;
			addChild(new Stats());
		}
	}
}