Skip to main content
Participant
April 24, 2008
Answered

movie only works in Flash Player 7?

  • April 24, 2008
  • 4 replies
  • 363 views
Hello,

I have a movie that works just fine if its Publish settings are Flash Player 7, but it won't work if it's set to Flash Player 8 or 9.

This movie is a text entry quiz in which the enduser enters letters in input text fields. The variable names for the input text fields are "textEntry1" though "textEntry5".

There are two frames. In the first frame, the answers are set like this:

answer1 = "C";
answer2 = "A";
answer3 = "E";
answer4 = "B";
answer5 = "D";

answer6 = "c";
answer7 = "a";
answer8 = "e";
answer9 = "b";
answer10 = "d";

stop ();

The enduser enters choices in five text fields and then selects a "Submit" button.

On frame two, I have another text field called finalScore that has this scripting:

onClipEvent (enterFrame) {
rightanswer = 0;

for (var i:Number = 1; i<=5; i++) {

if ((_root["textEntry" + i] == _root["answer" + i]) or
(_root["textEntry" + i] == _root["answer" + (i+5)])) {
(rightanswer = rightanswer + 1);
_root["correct" + i].gotoAndPlay (2);

}else{
_root["correct" + i].gotoAndPlay (3);
}
}
finalScore = "You matched " + rightanswer + " of 5 correctly.";
}

Like I said, this works just fine if the Publish settings are Flash Player 7. Can anyone point out to me why it won't work if the Publish settings are Flash Player 8 or 9?
Thanks!
This topic has been closed for replies.
Correct answer kglad
your clipevent is attached to a textfield??

p.s. replace your "or" with ||

4 replies

kglad
Community Expert
Community Expert
April 25, 2008
you're welcome.
kglad
Community Expert
Community Expert
April 24, 2008
yes, || replaced or.

i don't see any other problems in that code. is there other code?

if not, use the trace() function to see what things are undefined in your loop.
JMH5Author
Participant
April 25, 2008
Thanks, kglad, your original suggestion was correct. It wasn't working because of the extra space in the code. Once I removed that, it worked perfect.

thanks,
JMH
JMH5Author
Participant
April 24, 2008
your clipevent is attached to a textfield??

The textfield is inside a movieclip and the scripting is on the movieclip.

Did you mean like this:
if ((_root["textEntry" + i] == _root["answer" + i]) ||
(_root["textEntry" + i] == _root["answer" + (i+5)])) {

I tried that and it didn't work for me. Sorry, I'm entirely self taught and there are gaps in my knowledge. I've never seen the "|| " symbol before. I assume that it replaced "or" in actionscript 2?
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 24, 2008
your clipevent is attached to a textfield??

p.s. replace your "or" with ||