Next Director example

on preparemovie
  
  set visited1 = "FALSE"
  set visited2 = "FALSE"
  set visited3 = "FALSE"
  set visited4 = "FALSE"
  set visited5 = "FALSE"
  set visited6 = "FALSE"
  set visited7 = "FALSE"
  set visited8 = "FALSE"
  set visited9 = "FALSE"
  
  put 0 into scoretally
  put EMPTY into member "Time"
  put EMPTY into member "Scoredisplay"
end

on keyDown
  tempV = Sprite(2).locV
  tempH = Sprite(2).locH
  
  distance = 4
  case (the keyCode) of
    123:
      tempH = tempH - distance
      Sprite(2).locH = tempH
    124:
      tempH = tempH + distance
      Sprite(2).locH = tempH
    126:
      tempV = tempV -distance
      Sprite(2).locV = tempV
    125: 
      tempV = tempV + distance
      Sprite(2).locV = tempV
  end case
  
  if Sprite(2).locV < 0 then 
    Sprite(2).locV = 5
  end if
  updateStage
  
  if Sprite 2 intersects Sprite 1 then
    case (the keyCode) of
      123: Sprite(2).locH = tempH +4
      124: Sprite(2).locH = tempH -4
      126: Sprite(2).locV = tempV +4
      125: Sprite(2).locV = tempV -4
    end case
  end if
  
  
  if Sprite 2 intersects Sprite 3 then
    go next
  end if
  
  if Sprite 2 intersects Sprite 13 then
    if visited1 = "TRUE" then
    else
      go "Q1"
    end if
  end if
  
  if Sprite 2 intersects Sprite 14 then
    if visited2 = "TRUE" then
    else
      go "Q2"
    end if
  end if
  if Sprite 2 intersects Sprite 15 then
    if visited3 = "TRUE" then
    else
      go "Q3"
    end if
  end if
  if Sprite 2 intersects Sprite 16 then
    if visited4 = "TRUE" then
    else
      go "Q4"
    end if
  end if
  if Sprite 2 intersects Sprite 17 then
    if visited5 = "TRUE" then
    else
      go "Q5"
    end if
  end if
  if Sprite 2 intersects Sprite 18 then
    if visited6 = "TRUE" then
    else
      go "Q6"
    end if
  end if
  if Sprite 2 intersects Sprite 19 then
    if visited7 = "TRUE" then
    else
      go "Q7"
    end if
  end if
  if Sprite 2 intersects Sprite 20 then
    if visited8 = "TRUE" then
    else
      go "Q8"
    end if
  end if
  if Sprite 2 intersects Sprite 12 then
    if visited9 = "TRUE" then
    else
      go "Q9"
    end if
  end if
end

//after a question
on mouseup
  go to "Correct3"
end
on mouseup
  go to "Wrong3"
end
on exitFrame me
  set visited3 to "TRUE"
end
on exitFrame me
  scoretally = scoretally + 10
end

on exitframe me
  tempV = Sprite(2).locV
  tempH = Sprite(2).locH
end

if Sprite 2 intersects Sprite 15 then
    if visited3 = "TRUE" then
    else
      go "Q3"
    end if
  end if
 
on exitFrame me
  put scoretally into member "FinalScore"
  set quizTime to the timer
  qminutes = quizTime / 3600
  qseconds = quizTime / 60 - qminutes*60
  
  if (qseconds < 10) then
    qseconds = "0" & qseconds
  end if
  
  put integer(qminutes) & ":" & qseconds into member "Timefinal"
end