gpt4 book ai didi

actionscript-3 - 错误 #1010(可能是对象错误)

转载 作者:行者123 更新时间:2023-12-04 06:05:15 26 4
gpt4 key购买 nike

当我测试我的电影时,我收到了这个错误:TypeError: Error #1010: A term is undefined and has no properties。我认为这是由子对象引起的,但我无法修复它。我的代码:

var wPawn1:Object = new Object();
wPawn1.mc = new WhitePawn();
addChild(wPawn1.mc);

// Black inPeace variables
wPawn1.inPeace = "a2";

var pieces:Object = new Object();

pieces.a2.man = MovieClip(wPawn1.mc);
pieces.a2.x = 70;
pieces.a2.y = 491;

wPawn1.mc.x = pieces.a2.x;
wPawn1.mc.y = pieces.a2.y;

最佳答案

您需要定义 pieces.a2pieces.mc在定义 a2 的属性之前和 mc .

var pieces:Object = new Object();

pieces.a2 = blah;
pieces.mc = blah;

pieces.a2.man = MovieClip(wPawn1.mc);
pieces.a2.x = 70;
pieces.a2.y = 491;

wPawn1.mc.x = pieces.a2.x;
wPawn1.mc.y = pieces.a2.y;

为清楚起见,您的错误指的是 a2mc因为未定义且没有属性。

关于actionscript-3 - 错误 #1010(可能是对象错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8439669/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com