this is the code, i am using flex builder 4.5,
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
public var ss:Array = ["a", "b", "c"];
trace(ss[0]);
public var str:String = "Good Luck";
trace(str);
]]>
</fx:Script>
</s:Application>
i get red cross next to trace statment and fault is
“1120:Access of defined property ss”
i have tried the commented line as well but no luck. i have tried with 3.5, 4.1 and 4.5 sdk.
Am i missing something? please guide!!
(i tried googling it but nothing came up )
thanks in advance.
(updated the code)
public var ss:Stringis a field declaration andtrace(ss)is an action in code execution flow. Placetrace(ss)in an appropriate scope (in a function aka method) and it will be compiled and executed without any problem.