0

I have updated my script to what was mentioned below but i am still getting the same syntax erros...Any suggestions??

<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>            

But when i use this i get the following errors in flex:

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.

Help!!??!!

  • 1
    Your code is almost syntactically correct Java code, but you've tagged this as `flex4.6` and you mention `fx:Script`. I think you might be confused about what sort of programming language you're using. – Greg Hewgill Oct 19 '12 at 19:41

1 Answers1

1

In the following line you are not assigning the result to a variable

URL = new URL("http://www.rwolfc.com/App/TRY.txt");

It should be

URL url = new URL("http://www.rwolfc.com/App/TRY.txt");
Danny
  • 7,368
  • 8
  • 46
  • 70