0
首先,我想爲我可憐的英語道歉,因爲它不是我的第一語言。將AS3片段轉換爲AS2
我需要幫助將一塊AS3腳本轉換爲AS2,並且我知道它有點「你能爲我做」這個問題,但我真的無法設法將它整理出來。
這是一段腳本,需要轉換爲AS2:
var url:String = "http://media.admeen.com/branding/branding01.swf";
var w:int = 100;
var h:int = 100;
branding_def.addEventListener(MouseEvent.CLICK, onClickHandler);
branding_def.buttonMode = true;
branding_def.useHandCursor = true;
function onClickHandler(event:MouseEvent){
var variables:URLVariables = new URLVariables();
variables.lng = Capabilities.language;
var request:URLRequest = new URLRequest("http://media.admeen.com/branding/forward.php");
request.data = variables;
try {
navigateToURL(request, "_blank");
} catch (e:Error) {
trace("Error: ");
}
}
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, success);
if(Security.sandboxType == Security.REMOTE){
var context:LoaderContext = new LoaderContext();
context.securityDomain = SecurityDomain.currentDomain;
loader.load(new URLRequest(url), context);
} else {
loader.load(new URLRequest(url));
}
function success(evt:Event):void{
var branding:MovieClip = MovieClip(evt.target.content);
if (contains(branding_def)) removeChild(branding_def);
var fX = (w/branding.loaderInfo.width);
var fY = (h/branding.loaderInfo.height);
addChild(this.scaleToFit(branding,(branding.width*fX),(branding.height*fY)));
}
function scaleToFit(mc:MovieClip, maxW:int, maxH:int):MovieClip{
maxH = maxH == 0 ? maxW : maxH;
mc.width = maxW;
mc.height = maxH;
mc.scaleX < mc.scaleY ? mc.scaleY = mc.scaleX : mc.scaleX = mc.scaleY;
return mc;
}
我真的希望你們能幫助我!
親切的問候
爲什麼你會轉換爲較舊的動作? – poepje
這是用於較舊的Flash文件 –
你的英語幾乎沒有任何道歉。你寫的是一個非美國方言的母語人士。 – Panzercrisis