作者pk9527108 (真的累了)
看板Flash
标题Re: [问题] 出现的问题
时间Mon Feb 2 16:04:28 2009
XDDDDDDDDDDD
一个解决後又一个问题
X:10
Y:10
0
ReferenceError: Error #1069: builtin.as$0.MethodClosure 上找不到属性 circle5,
而且没有预设值。
at _fla::MainTimeline/count()
at _fla::MainTimeline/container2EnterFrameHandler()
不大懂~"~
※ 引述《pk9527108 (真的累了)》之铭言:
: 各位好
: 以下先呈现程式码
: 由於我算是代po的
: 所以只能先呈现目前程式码
: 稍後描述问题
: import flash.display.Sprite;
: var container1:Sprite = new Sprite();
: container1.x=250;
: container1.y=180;
: var container2:Sprite = new Sprite();
: addChild(container2);
: //红
: var circle1:Sprite = new Sprite();
: circle1.graphics.beginFill(0xFF0000);
: circle1.graphics.drawRect(-50, -50, 100,100);
: circle1.z=-50;
: //绿
: var circle2:Sprite = new Sprite();
: circle2.graphics.beginFill(0x00FF00);
: circle2.graphics.drawRect(-50, -50, 100,100);
: circle2.x=50;
: circle2.rotationY=-90;
: //黄
: var circle3:Sprite = new Sprite();
: circle3.graphics.beginFill(0xFFFF33);
: circle3.graphics.drawRect(-50, -50, 100,100);
: circle3.z=50;
: //蓝
: var circle4:Sprite = new Sprite();
: circle4.graphics.beginFill(0x0000CC);
: circle4.graphics.drawRect(-50, -50, 100,100);
: circle4.z=0;
: circle4.x=-50;
: circle4.rotationY=-90;
: //紫色
: var circle5:Sprite = new Sprite();
: circle5.graphics.beginFill(0xCC00FF);
: circle5.graphics.drawRect(-50, -50, 100,100);
: circle5.y=-50;
: circle5.rotationX=90;
: //桃红
: var circle6:Sprite = new Sprite();
: circle6.graphics.beginFill(0xFF00FF);
: circle6.graphics.drawRect(-50, -50, 100,100);
: circle6.y=50;
: circle6.rotationX=90;
: container2.addChild(container1);
: container1.addChild(circle6);
: container1.addChild(circle4);
: container1.addChild(circle3);
: container1.addChild(circle2);
: container1.addChild(circle5);
: container1.addChild(circle1);
: var t:Boolean=false;
: container2.addEventListener(MouseEvent.MOUSE_DOWN,
: container2EnterFrameHandler);
: var num:Array=new Array("5","1","2",//1
: "3","5","2",//2
: "5","4","3",//3
: "5","4","1",//4
: "1","6","2",//5
: "6","2","3",//6
: "4","6","3",//7
: "4","6","1");//8
: var i:Number=0;
: function container2EnterFrameHandler(event:MouseEvent):void{
: /*if(t==false){
: trace("测");
: t=true;
: //container1.swapChildrenAt(3,1);
: container1.swapChildrenAt(2,0);
: }*/
: container1.rotationY+=10;
: container1.rotationX+=10;
: trace("X:"+ container1.rotationY);
: trace("Y:"+container1.rotationX);
: trace(Math.floor(container1.rotationY %360/90));
: switch(Math.floor(container1.rotationY %360/90)){
: case 0:
: switch(Math.floor(container1.rotationX %360/90)){
: case 0:
: count(1);
: break;
: case 1:
: count(2);
: break;
: case 2:
: count(3);
: break;
: case 3:
: count(4);
: break;
: }
: break;
: case 1:
: switch(Math.floor(container1.rotationX %360/90)){
: case 0:
: count(2);
: break;
: case 1:
: count(6);
: break;
: case 2:
: count(7);
: break;
: case 3:
: count(3);
: break;
: }
: break;
: case 2:
: switch(Math.floor(container1.rotationX %360/90)){
: case 0:
: count(6);
: break;
: case 1:
: count(5);
: break;
: case 2:
: count(8);
: break;
: case 3:
: count(7);
: break;
: }
: break;
: case 3:
: switch(Math.floor(container1.rotationX %360/90)){
: case 0:
: count(5);
: break;
: case 1:
: count(1);
: break;
: case 2:
: count(4);
: break;
: case 3:
: count(8);
: break;
: }
: break;
: }
: }
: function count(c:Number):void{
: for(var t=0 ; t<6 ; t++)
: container1.removeChildAt(0);
: container1.addChild(circle+"num[(c-1)*3]");
: container1.addChild(circle+"num[(c-1)*3+1]");
: container1.addChild(circle+"num[(c-1)*3+2]");
: }
: 接着就是想请教的问题
: 在最後一段程式当中
: 也就是
: 最下面 那 container1.addChild(circle+"num[(c-1)*3]");
: container1.addChild(circle+"num[(c-1)*3+1]");
: container1.addChild(circle+"num[(c-1)*3+2]");
: 出现了以下问题:
: 1120: 存取未定义的属性 circle。
: 1067: String 类型值以隐含方式强制转型成不相关的类型
: flash.display:DisplayObject。
: 1120: 存取未定义的属性 circle。
: 1067: String 类型值以隐含方式强制转型成不相关的类型
: flash.display:DisplayObject。
: 1120: 存取未定义的属性 circle。
: 1067: String 类型值以隐含方式强制转型成不相关的类型
: flash.display:DisplayObject。
: 想请教一下如何改善呢
: 备注:本程式码是用AS3.0撰写
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.198.172.92