Flash 板


LINE

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







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Tech_Job 或 站内搜寻

TOP