【发布时间】:2017-01-26 05:18:28
【问题描述】:
我有一个字符串数组:
private var phrase:Array = ["You will be given a series of questions like this:\n2 + 2 =\n(click or press ENTER to continue)","You can use the Keyboard or Mouse\nto deliver the answer\n\"ENTER\" locks it in.\n(click or press ENTER to continue)","\nClick Here\n to start."];
我在脚本后面有一个条件来查看phrase[0] 是否等于instructText.text,所以我在赋值之后直接放了一个“测试”,如下所示:
instructText.text = phrase[0];
if (instructText.text == phrase[0]) {
trace("phrase zero");
}
else {
trace("nottttttttt");
}
//OUTPUT: nottttttttt
我尝试了phrase[0] as String 和String(phrase[0]) 的各种组合,但都没有成功。
我错过了什么?
【问题讨论】:
-
在
if/else语句之前,你为什么不直接trace("phrase 0 is : " + String(instructText.text) );,它看起来像什么?不相等/不准确?
标签: string actionscript-3 if-statement textfield multilinestring