Chapter 4. Gluing Your App Together with Events, Variables, and Callbacks
The last chapter showed how proper design methodologies could improve the structure of an app, how code reuse could be maximized by using an MVC framework, and how layouts for different platforms could be accommodated. For this chapter we move our focus back to the code level and look at how elements of an app fit together and communicate with each other. We will see how, for example, a picker will indicate the selected value to a label, or how you update a progress bar. We will dive into learning principles of events and callbacks that will be used extensively throughout the remainder of the book.
This chapter exposes the glue that holds your Titanium apps together. This will help you move on from small example apps with single buttons and alert boxes that have been shown in the book so far to more complex, interconnected, engaging apps. We will also continue to focus on code quality by showing how to avoid trouble...