Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quiz help for newb - thanks

Status
Not open for further replies.

fjp476

Technical User
Dec 28, 2001
113
US
Hi,
I'm trying to make a simple 6 question quiz. I've made a global variable named gScore with this code:
global gScore

on startMovie me
gScore = 0
end

I have this code on each of the 6 correct buttons:
on mouseUp
gScore = gScore + 1
end

I tried adding this code to the final correct button:

on mouseUp
if gScore > 4
go to "pass"
else
go to "fail"
end

but I get an error mesage that says " Script error:Variable used before assigned a value
ifgScore >?4

Obviously I'm doing something wrong or missing a step (or 2 or 3). Would anyone please take pity on a newb and point me in the right direction? I'd really appreciate it. Thanks.


Cheers~Frank
 
Are you including the line "global gScore" at the beginning of all of your scripts that refer to it? It looks like that might be missing and therefore the script doesn't know that gScore has a value.

Hope it's this simple!
 
I was, and I hope so too. Thanks, I'll let you know.

Cheers~Frank
 
That was it! Thanks again!

Cheers~Frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top