
รบกวนผู้รู้ช่วยทีพอดีว่าทำสื่อการสอนในโปรแกรม flash แล้วติด error อยู่สามจุด ทำต่อไปไม่เป็นแล้วงานด่วนมาก โดยส่วนที่ติดเป็นหน้าโค้ตของแบบทดสอบแบบตัวเลือก
-------โค้ต-------
stop();
var NumberofQ:int = 10;
var Question

bject = new Object();
var RightAnsArray:Array = ["ข","ก","ง","ง","ค","ก","ง","ก","ข","ง"]
var Score:int = 0;
var AnsRight:int = 0;
var AnsWrong;int = 0;
Question.CurrentQ = 0;
NewQuestion();
function NewQuestion(){
Question.CurrentQ++;
Question.Choose = "";
Ansก.buttonMode = true;
Ansข.buttonMode = true;
Ansค.buttonMode = true;
Ansง.buttonMode = true;
Ansก.addEventListener(MouseEvent.CLICK, onAns);
Ansข.addEventListener(MouseEvent.CLICK, onAns);
Ansค.addEventListener(MouseEvent.CLICK, onAns);
Ansง.addEventListener(MouseEvent.CLICK, onAns);
Btn_Next.addEventListener(MouseEvent.MOUSE_UP, onNext);
}
function onAns(evt:MouseEvent):void{
Question.Choose = (evt.target.name).slice(-1,4)
tetError.text = "";
}
function onNext(evt:MouseEvent):void{
if (Question.Choose !=""){
if (Question.Choose == RightAnsArray[Question.CurrentQ - 1]){
Score++;
AnsRight++;
}else{
AnsWrong++;
}
NextFrame();
if (Question.CurrentQ <NumberofQ){ <<<<<<< บรรทัดนี้ที่ติด error <<<<<<<<
NewQuestion();
}
}else{
tetError ="กรุณาเลือกคำตอบ";
}
}
----------------------------------------------------------
โปรแกรมบอกมาประมาณนี้
Scene 4, Layer 'Layer 9', Frame 1301, Line 39 1084: Syntax error: expecting identifier before rightparen.
Scene 4, Layer 'Layer 9', Frame 1301, Line 39 1008: Attribute is invalid.
Scene 4, Layer 'Layer 9', Frame 1301, Line 39 1084: Syntax error: expecting rightparen before semicolon.
จะต้องแก้ไขตรงไหนยังไงบ้าง พิมแก้ให้เลยจะขอบคุณมากๆเลยคับเพราะฟังอธิบายไม่ค่อยรู้เรื่อง
โค้ต flash มีปัญหา ติด error
-------โค้ต-------
stop();
var NumberofQ:int = 10;
var Question
var RightAnsArray:Array = ["ข","ก","ง","ง","ค","ก","ง","ก","ข","ง"]
var Score:int = 0;
var AnsRight:int = 0;
var AnsWrong;int = 0;
Question.CurrentQ = 0;
NewQuestion();
function NewQuestion(){
Question.CurrentQ++;
Question.Choose = "";
Ansก.buttonMode = true;
Ansข.buttonMode = true;
Ansค.buttonMode = true;
Ansง.buttonMode = true;
Ansก.addEventListener(MouseEvent.CLICK, onAns);
Ansข.addEventListener(MouseEvent.CLICK, onAns);
Ansค.addEventListener(MouseEvent.CLICK, onAns);
Ansง.addEventListener(MouseEvent.CLICK, onAns);
Btn_Next.addEventListener(MouseEvent.MOUSE_UP, onNext);
}
function onAns(evt:MouseEvent):void{
Question.Choose = (evt.target.name).slice(-1,4)
tetError.text = "";
}
function onNext(evt:MouseEvent):void{
if (Question.Choose !=""){
if (Question.Choose == RightAnsArray[Question.CurrentQ - 1]){
Score++;
AnsRight++;
}else{
AnsWrong++;
}
NextFrame();
if (Question.CurrentQ <NumberofQ){ <<<<<<< บรรทัดนี้ที่ติด error <<<<<<<<
NewQuestion();
}
}else{
tetError ="กรุณาเลือกคำตอบ";
}
}
----------------------------------------------------------
โปรแกรมบอกมาประมาณนี้
Scene 4, Layer 'Layer 9', Frame 1301, Line 39 1084: Syntax error: expecting identifier before rightparen.
Scene 4, Layer 'Layer 9', Frame 1301, Line 39 1008: Attribute is invalid.
Scene 4, Layer 'Layer 9', Frame 1301, Line 39 1084: Syntax error: expecting rightparen before semicolon.
จะต้องแก้ไขตรงไหนยังไงบ้าง พิมแก้ให้เลยจะขอบคุณมากๆเลยคับเพราะฟังอธิบายไม่ค่อยรู้เรื่อง