0
我已经更新了我的脚本,以下提到的内容,但我仍然得到相同的语法错误...任何建议?正确地从服务器读取文本
<fx:Script>
<![CDATA[
try {
URL url = new URL("http://www.rwolfc.com/App/TRY.txt"){;
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String str;
while ((str = in.readLine()) != null) {
}
in.close();
} catch (MalformedURLException e) {
} catch (IOException e) {
}
]]>
</fx:Script>
但是当我使用这个我得到了柔性以下错误:
1071: Syntax error: expected a definition keyword (such as function) after attribute String, not str.
1073: Syntax error: expecting a catch or finally clause.
1084: Syntax error: expecting rightbrace before leftbrace.
帮助!! ?? !!
你的代码几乎是语法正确的Java代码,但你这个标记为' flex4.6',你提到'fx:Script'。我想你可能会对你正在使用的编程语言感到困惑。 –