forked from: Version Check for Flash Player 10.1
/**
* Copyright ongaeshi ( http://wonderfl.net/user/ongaeshi )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/nsVZ
*/
// 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.*;
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.RIGHT;
addChild(tf);
// if (major >= 10 && minor >= 1)
if (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;
}
}
}