This content has been marked as final. Show 3 replies
package defines the location/namespace of a class. It does not stand alone in a file.1 person found this helpful
You need to declare the class inside the package definition, and your properties and methods on that class.
Find an example in the docs.
but what if i need to define only some common functions for my application.
Then do i need to define it inside a class only or i can define it without package also.\
How can i define these functions?
"package" only applies to implementing AS classes.1 person found this helpful
Any function you declare in a component, whether in an mxml file Script block, or in an AS file included using the mx:Script source="myfile.as" is scoped to that component. If declared public, the methods can be accessed via a reference to an instance of that component.
There are many ways to communicate between component instances.
Perhaps you should tell us what you want to do, more specifically. I think you need to understand and define your application architecture first.