未定义的属性的访问? ActionScript 3的 [英] Access of Undefined property? Actionscript 3
问题描述
我是编程的东西,当我以为一切都不错,不错,闪光灯抛出一个错误给我!?
起初我是目瞪口呆。然后检查我的code后,我看不到的罪魁祸首。所以我所做的就是简单下来,并改变它只是一个跟踪语句。
我仍然但是得到错误。我不知道什么是错的。
包{
进口的flash.display.MovieClip;
进口src.data.DActors;
公共类的DocumentClass扩展影片剪辑{
公共变种dActors:DActors =新DActors;
公共职能的DocumentClass(){
跟踪(dActors);
跟踪(主);
}
}
}
这是DActors类:
包src.data
{
公共类DActors
{
公共变种我:INT = 1;
公共职能DActors();
{
跟踪(箱);
}
}
}
一些余地,我不知道的东西?
哦,对了,它引发了'我'没有定义!?
编辑:其实,我没有意识到真正的问题,凭啥是我的构造函数不接受变量
! 包src.data
{
公共类DActors
{
公共变种演员:阵列=新的Array();
公共变种dActor:DActor =新DActor();
公共职能DActors();
{
actors.push(dActor);
}
}
}
输出:
1120:未定义的属性演员访问
1120:未定义的属性dActor的访问
????这让我担心很大。无论是我的眼睛骗了我还是我失去了一些非常基本的。
公共职能DActors();
构造函数不会与结束。
(分号)
I was programming something and when I thought everything was nice and good, Flash throws an error to me!?
At first I was dumbstruck. Then after checking my code, I couldn't see the culprit. So what I did was 'simple it down', and changed it to just a trace statement.
I was still however getting the error. I don't know what is wrong.
package {
import flash.display.MovieClip;
import src.data.DActors;
public class DocumentClass extends MovieClip {
public var dActors:DActors = new DActors;
public function DocumentClass() {
trace (dActors);
trace ("Main");
}
}
}
This is the DActors Class:
package src.data
{
public class DActors
{
public var me:int = 1;
public function DActors();
{
trace(me);
}
}
}
Some scope I'm not aware of or something?
Oh, and by the way, it throws that ''me' is not defined'!?
EDIT: Actually, I failed to realize the real problem, why the hell is my constructor not accepting variables!
package src.data
{
public class DActors
{
public var actors:Array = new Array();
public var dActor:DActor = new DActor();
public function DActors();
{
actors.push(dActor);
}
}
}
outputs:
1120: Access of undefined property actors.
1120: Access of undefined property dActor.
???? This worries me greatly. Either my eyes are fooling me or I'm missing something very basic.
public function DActors();
Constructor function will not end with ;
(semicolon).
这篇关于未定义的属性的访问? ActionScript 3的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!