我有一个项目,我需要更新表格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