I’m currently maintaining some flex code and noticed very many functions which are declared like:
private function exampleFunc():void { .... }
These functions are in the global scope, and aren’t part of any specific class, so it’s a bit unclear to me what effect declaring them as private would have. What restrictions does the ‘private’ qualifier have for functions like this?
The actionscript functions that are included in your mxmlc code will we available as a part of your mxmlc component, which behind the scenes is compiled into a class. Therefore marking them as private makes them inaccessible.
Here is an example to make that clear, say you have the following component, we’ll call it FooBox:
I can now add FooBox to my application, and use it’s functions:
If the actionscript functions are included in your Main Application file, the I think you can call the functions from an child control through the Application.application object, something like:
if the bar function was placed in the main mxmlc code.