FLASH AS3.0:点击退出按钮(没法隐藏全部的文本框和按钮,只能隐藏最后一个),要如何修改才能全部隐藏
代码都是写在帧上的:varsubjectArray:Array=newArray("圆命令的快捷键是__","L是哪个命令是快捷键?");//选项问题varselectA...
代码都是写在帧上的:var subjectArray:Array = new Array("圆命令的快捷键是__","L 是哪个命令是快捷键?");//选项问题var selectArray:Array = new Array("A. C" ,"B. R" ,"C. A ","D. L","A.构造线 ","B.直线 ","C.矩形"," D.多线 ");//选项题var answerArray:Array = new Array("A","B");var showArray:Array=new Array();var nameArray:Array=new Array();var scoreArray:Array=new Array();var scoreNum:Number = 100 / subjectArray.length;var score:int;var totalScore:int;var isplay:Boolean;var field:TextField=new TextField();var format:TextFormat = new TextFormat("长城新艺体");field.defaultTextFormat = format;field.text = "成绩:" + " " + "分";addChild(field);field.y = 300;// 成绩分数的位置field.x = 200;for (var k:int=0; k<subjectArray.length; k++){ var subject_text:TextField=new TextField(); subject_text.x = 170;//题目所在的位置 subject_text.y = 50 * k + 40; //题目与题目之间的距离 subject_text.width = 300; subject_text.mouseEnabled = false;//鼠标点击事件,subject_text不阻挡 subject_text.defaultTextFormat = format; subject_text.text = (k + 1) + "." + subjectArray[k] + "?"; addChild(subject_text); var show:Show=new Show(); show.y = 60 + k * 50; //间距 show.x = 150;//()所在的位置 show.show_text.mouseEnabled = false; show.index_text.text = (k + 1) + "."; show.index_text.mouseEnabled = false; show.judge_text.mouseEnabled = false; showArray.push(show); addChild(show);}for (var s:uint=0; s<selectArray.length; s++){ var selectButton:Button=new Button(); addChild(selectButton); selectButton.x = 220 + s % 4 * 75; //按钮选项的位置和间距 selectButton.y=55+Math.floor(s/4)*50; selectButton.button_text.text = selectArray[s]; selectButton.name = s.toString(); nameArray.push(selectArray[s].charAt(0));//charAt()方法返回指定索引位置的char值。索引范围为0~length()-1. selectButton.addEventListener(MouseEvent.CLICK,selectButtonClick);}............var turnButton:Button=new Button();addChild(turnButton);turnButton.x = 400; //按钮的位置turnButton.y = 300;turnButton.button_text.text = "退出";turnButton.addEventListener(MouseEvent.CLICK,turnButtonClick);function turnButtonClick(event:MouseEvent):void{ show.visible=false; //show影片隐藏 field.visible=false; //分数隐藏 turnButton.visible=false;//退出按钮隐藏 button.visible=false;//提交/清除按钮隐藏 subject_text.visible=false;//题目隐藏 selectButton.visible=false;//选项隐藏 this.gotoAndPlay(1);}
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询