I have a simple object defined by an object literal, and have a couple functions assigned to this object. Inside the functions, I try to access global variables, and it only gets undefined. The Flex debugger tells me the variables are just right up the scope tree.
Yes, I know I can access Thing by using 'this', that doesn't solve my scope issue though.
Project Flex Compiler Settings: Flex SDK 3.4, Require Flash Player 10.x.
Example:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="Thing.bling();">
<mx:Script>
<![CDATA[
var Thing:Object = {
doStuff: function():void {
trace(blah); //blah is undefined
},
bling: function():void {
Thing.doStuff(); //Thing is undefined
},
};
]]>
</mx:Script>
<mx:Panel id="blah">
</mx:Panel>
</mx:Application>