package {
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageQuality;
import flash.net.URLRequest;
import flash.system.Capabilities;
import flash.system.IME;
import flash.display.StageScaleMode;
[SWF(width="400",height="300",backgroundColor="#00ffee",frameRate="32")]
public class actionscript3 extends Sprite
{
public function actionscript3(){
trace(flash.system.Capabilities.hasStreamingVideo);
trace(flash.system.Capabilities.version);
//flash.system.Security.showSettings();
flash.display.StageAlign.RIGHT;
flash.display.StageQuality.BEST;
//判断操作系统类型
var os:String = flash.system.Capabilities.os;
switch (os){
case "Windows XP":
trace("windows");
break;
case "Linux":
trace("Linux");
break;
case "Mac":
trace("Mac");
break;
default:
trace("Unknow OS");
}
//判断播放器类型
var player:String = flash.system.Capabilities.playerType;
switch (player){
case "PlugIn":
trace("Firefox plugin" + String);
break;
case "ActiveX":
trace("IE" + String);
break;
default:
trace("Unknow player.");
}
//判断语言
//trace(flash.system.Capabilities.language);
var language:String = flash.system.Capabilities.language;
var languages:Array = new Array();
languages["en"] = "en";
languages['cn'] = "cn";
if ( language.substr(0,2) == "zh" ){
trace("中文");
}else if ( language.substr(0,2) == "en" ){
trace("英文");
}else{
trace("暂不支持");
}
trace(flash.system.Capabilities.hasIME);
trace(flash.system.IME.enabled);
var string2:String = "e4d909c290d0fb1ca068ffaddf22cbd0";
trace(string2.toUpperCase());
//检测屏幕分辨率
var resX:int = flash.system.Capabilities.screenResolutionX;
var resY:int = flash.system.Capabilities.screenResolutionY;
var url:String;
if (resX <= 240 && resY <= 320){
url = "main_pocketPC.swf";
}else{
url = "main_desktop.swf";
}
//根据不同的设备载入不同的影片
//loader.load(new URLRequest(url));
//根据分辨率居中对话框
var winW:int = 240;
var winH:int = 320;
//水平居中
var winX:int = (resX/2) - (winW/2);
var winY:int = (resY/2) - (winH/2);
var jsCode:String = "javascript:void(newWin=window.open(''," + "'newWindow', 'width=" + winW +", height=" + winH + "," + "left=" + winX + ",top=" + winY + "'));";
//urlLoader.load(new URLRequest(jsCode));
//播放影片时的变形模式:NO_BOARD、EXACTFIT、NOSCALE和SHOW_ALL
//当影片在播放器中播放的时候,可以通过上面的四个值对硬盘的变形进行切换
//需要手工导入flash.display.StageScaleMode类,否则会出现错误
//stage本身不是一个全局的对象。但是涉及到显示的类比如:sprite,可以使用这个属性。
//SHOW_ALL,flash播放器默认的选项。在这种情况下,影片随着播放器的调整而调整,如果播放器和影片的尺寸不符合,可能会出现边框。
stage.scaleMode = StageScaleMode.SHOW_ALL;
//NO_BORDER,这种情况下,可能影片的部分内容因为调整了播放器而不能显示出来。
stage.scaleMode = StageScaleMode.NO_BORDER;
//EXACT_FIT,影片会强制和播放器的变形一致,这样的话,可能导致影片的内容编写。
stage.scaleMode = StageScaleMode.EXACT_FIT;
//NO_SCALE,不能调整的模式,这种情况下需要设置影片的基准线
stage.scaleMode = StageScaleMode.NO_SCALE;
//ScaleMode不能阻止右键调整的情况。
}
public static function checkIp():String{
return actionscript3.checkIp();
}
}
}