ViewStack objects cause TypeError: Error #1009
Cannot access a property or method of a null object reference.
Viewstacks are great for hiding and showing groups of objects. For example you can display a datagrid with all your "Contacts" from an address book. Click on a person's name and display an "edit form" in the second viewstack position with all the contact details ready to edit.
The problem is when you try to set the details into the form input fields you get the TypeError #1009.
The reason is your viewstack does not create your form when the component is initialized. You have to tell the viewstack to create ALL the objects on initialization.
<mx:ViewStack
width="100%"
height="100%"
creationPolicy="all">
<view:ContactList />
<view:ContactForm />
</mx:ViewStack>
Recent Comments