ということでAdobe directorを使ってクイズを作っているのですが、全体的な環境に苦労しています。
次の Lingo スクリプトを各ボタンに追加して、正解を表示します。
on mouseDown
global gscore
set gscore = gscore + 1
そして最終段階では、次の Lingo スクリプトを使用して取得ポイントを確認し、結果に応じたスプライトを表示します。
on enterFrame
if gscore = 0 then set the memberNum of sprite (3) to 154
end if
if gscore = 1 then set the memberNum of sprite (3) to 155
end if
if gscore = 2 then set the memberNum of sprite (3) to 156
end if
if gscore = 3 then set the memberNum of sprite (3) to 157
end if
if gscore = 4 then set the memberNum of sprite (3) to 158
end if
if gscore = 5 then set the memberNum of sprite (3) to 159
end if
end
私のエラーは、宣言された変数がないと言っているようですが、それはグローバルですよね? では、なぜそれを認識しないのでしょうか。最初のスクリプトは正解に対応するボタンに添付され、各ボタンには次の問題に送信するための個別のスクリプトがあります。結果を表示する最終段階では、gscore の値に応じて特定のカスタム スプライトを表示する必要があります。