我有一個項目,我需要更新表格AS2到AS3,因爲我需要一些新的功能可用於垂直居中文本。幫助需要與Flash AS2到AS3轉換,有重大問題
我在時間線上的當前AS2代碼如下。
var dataField = _root.dataField;
var dataType = _root.dataType;
var dataPage = _root.dataPage;
var dataVar = _root.dataVar;
_root.mc.onRelease = function() {
getURL("index.php?page="+dataPage+"&num="+dataNum+"&"+dataType+"="+dataVar, "_self");
};
而我的外部AS文件如下。
import mx.transitions.Tween;
/**
*
* StandardKey is attached to a movieclip in the library.
* It handles the basic button behavior of the keyboard keys.
* When each button is placed on the stage, it's instance name
* will be the unique ID of the key.
*
*/
class StandardKey extends MovieClip {
///////////////////////////////////////
//Stage Elements
var highlight:MovieClip;
//End Stage Elements
var highlightTween:Tween;
function StandardKey(Void) {
//Repaint the key with 0 alpha
highlight._alpha = 0;
}
function onPress(Void):Void {
//Do the highlight animation
highlightTween.stop();
highlightTween = new Tween(highlight, "_alpha", mx.transitions.easing.Regular.easeInOut, 100, 0, 10, false);
}
}
這是我在移動的時間表和外部AS2到AS3
時間軸的嘗試,我現在:
var dataField = this.dataField;
var dataType = this.dataType;
var dataPage = this.dataPage;
var dataVar = this.dataVar;
var dataNum = this.dataNum;
_root.mc.onRelease = function() {
navigateToURL(new URLRequest("index.php?page="+dataPage+"&num="+dataNum+"&"+dataType+"="+dataVar, "_self"));
};
外部AS3我有
package {
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.MovieClip;
/**
*
* StandardKey is attached to a movieclip in the library.
* It handles the basic button behavior of the keyboard keys.
* When each button is placed on the stage, it's instance name
* will be the unique ID of the key.
*
*/
public class StandardKey extends MovieClip {
///////////////////////////////////////
//Stage Elements
var highlight:MovieClip;
//End Stage Elements
var highlightTween:Tween;
public function StandardKey(Void) {
//Repaint the key with 0 alpha
highlight._alpha = 0;
}
public function onPress(Void):void {
//Do the highlight animation
highlightTween.stop();
highlightTween = new Tween(highlight, "_alpha", fl.transitions.easing.Regular.easeInOut, 100, 0, 10, false);
}
}
}
我是錯誤的目前得到的是:
場景1,圖層'標籤',第1幀,第6行1120:訪問未定義屬性_root。 場景1,圖層「標籤」,第1幀,第7行1137:參數的數量不正確。預計不會超過1.
如果有人能幫助我解決這個問題,我將非常感激。
親切的問候 墊。
我真的不知道你在問什麼 - 如果你發佈你得到的錯誤,或者在AS3已經嘗試了代碼可能有幫助,所以我們可以幫助找出你要出錯的地方。 – quoo 2010-05-03 15:12:54
嗨quoo我已經添加了我目前已有的原始帖子的結尾,希望這是更多的信息。謝謝:) – Mat 2010-05-03 16:02:33