Hello. I am writing a method that will randomly generate a number, set 2 questions equal to the random position in a list, set a new variable to store these questions, then randomly pick one of these questions from the new varialbe and display the info in a message box.

Below is the sample code. Part 1 works, part 2 does not.When i run part 2 i get the "Script error: object expected member("Eqnm1box").text=gquestion. Any ideas. I greatly appreciate your time.
on BeginSprite me

set rnum1 = random(2)

set rnum2 = random(2)

set rnum3 = random(2)

comboquestion = member("WordEqnComboField").line[rnum1].item[2]

decompquestion = member("WordEqnDecompositionField").line[rnum1].item[2]

gquestion = []

add gquestion, comboquestion

add gquestion, decompquestion

member("eqn1box").text = gquestion[rnum3]

on exitframe

go to the frame

end

----------------------------------------

on BeginSprite me

getrnum(me)

getQuestion(me)

setQuestion(me)

displayQuestion(me)

end

on getrnum me, rnum1,rnum2,rnum3


set rnum1 = random(2)

set rnum2 = random(2)

set rnum3 = random(2)

end

on getQuestion me,comboquestion,rnum1,decompquestion,rnum2

comboquestion = member("WordEqnComboField").line[rnum1].item[2]

decompquestion = member("WordEqnDecompositionField").line[rnum1].item[2]

end

on setQuestion me, gquestion,comboquestion,decompquestion,rnum3

gquestion = []

add gquestion, comboquestion

add gquestion, decompquestion

end

on displayQuestion me, gquestion,rnum3

member("eqn1box").text = gquestion[rnum3]

end

on exitframe

go to the frame

end




Kevin Pyatt
Ponderosa High School
Chemistry Teacher
Multimedia Developer/Instructional Designer

Scientific Creations
Business line:303.829.8960
www.scientificcreations.com




_________________________________________________________________
The new MSN 8: smart spam protection and 3 months FREE*. http://join.msn.com/?page=features/junkmail&xAPID=42&PS=47575&PI=7324&DI=7474&SU= http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_smartspamprotection_3mf

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

Reply via email to