;

PDA

Click to See Complete Forum and Search --> : Koolmoves and Flash trace


jarnold
05-31-2009, 12:56 AM
Hi,
The "exchange menu1" and "arrays, strings" threads can be closed. Thanks for the solution.
Next problem!
Why doesn't Koolmoves use trace?
I have two txtboxes, one shows % correct (works) and the other is for a conditional response but this is not working. Can someone tell me why?

txt7var = Math.round((new_score/4)*100);
txt9var = "";
this.onEnterFrame = function() {
if (this._currentframe == '14') {
if(txt7var >= 70){txt9var.text = 'well done'}

}else if(txt7var <= 69){txt9var.text = 'repeat'}


}
}
}
}
Selection.setFocus("txt9var");
stop();
thanks,
ja

Bob Hartzell
05-31-2009, 08:00 AM
I believe _currentframe should be a number (I am not an action script expert).

In this._currentframe == '14'
the value being tested is a string

w.brants
05-31-2009, 08:42 AM
I have two txtboxes, one shows % correct (works) and the other is for a conditional response but this is not working. Can someone tell me why?
A textfield variable and a textfield name are not the same.
You can set a text to txt9var or to txt9.text but not to txt9var.text since txt9var is a variable and not a dynamic textfield. For the same reason your setFocus will fail the way you used it. You can set focus to a textfield instance but not to a variable.

jarnold
05-31-2009, 09:10 AM
A textfield variable and a textfield name are not the same.
You can set a text to txt9var or to txt9.text but not to txt9var.text since txt9var is a variable and not a dynamic textfield. For the same reason your setFocus will fail the way you used it. You can set focus to a textfield instance but not to a variable.

Thanks to you both for the reply
Didn't see the '14'. Still not working properly. Less than 70% shows " you should repeat this" but 100% doesn't show "well done".

txt7var = Math.round((new_score/4)*100);
txt9var = "";
this.onEnterFrame = function() {
if (this._currentframe == 'score') {
if(txt7var >= 70){txt9.text = 'Well done'}

}else if(txt7var < 70){txt9.text = 'You should repeat this'}


}
}
}
}
Selection.setFocus("txt9var");
stop();

thanks
ja

jarnold
06-02-2009, 11:59 PM
Hi all,
I've tried suggested changes.
If I change 'score' to (18) - frame which scores the < 70 doesn't work but the >=70 returns 'well done'.
If I leave 'score' then >=70 returns nothing but <70 works and returns 'repeat this'.
I can't seem to be able to get both conditions to work depending on the score.

txt7var = Math.round((new_score/4)*100);
txt9var = "";
this.onEnterFrame = function() {
if (this._currentframe == 'score') {
if(txt7var >= 70){txt9.text = 'Well done'}

}else if(txt7var < 70){txt9.text = 'You should repeat this'}


}
}
}
}
Selection.setFocus("txt9var");
stop();

thanks,
ja