How can we access variable or function created in parent and MXML
component from each other?
You shouldn't. A component should never know anything about it's parent, as that is considered an encapsulation break. Breaks in encapsulation make your code less reusable. I wrote an in depth blog post about how two components should communicate with each other.
How can we access element in parent or MXML component for each other?
Meaning, if in MXML component has a textinput, how can we access the
textinput value from the parent or vice versa?
As I said above, you shouldn't.
What many people do in order to help share values across an application is to create some type of model class to store the data. So, your parent component will store the TextInput's text value into the model class somehow, perhaps through the use of Binding.
Then you add the same instance of the Model class into the child; and it can access the same value. There are a handful of ways to accomplish this.
You could create your model class with all static variables.
You could create your model class as a Singleton and therefore only create a single instance of it; then add a "getInstance()" method used by all classes.
You could use a Dependency Injection Framework to add your model class into both the parent and child. Frameworks such as Swiz and Robotlegs both support Dependency Injection.
I have used all the above approaches for different projects. The third approach, using a framework, is the most common approach in Enterprise level applications where things can get very complex very quickly.