This content has been marked as final. Show 3 replies
What is happening is that since labelb is inside an entry of the ViewStack which is not yet visible, it has not yet been initialized. That is, 'labelb' is a valid variable name, but it refers to a variable whose value is still null. A Label will not be created and assigned to the variable 'labelb' until the first time that Canvas of the ViewStack becomes the visible one.
Since the "creationComplete" event is valid for individual UIComponents as well as for the entire Application, one way to write this would be to have a creationComplete event on the Label:
<mx:Label width="200" id="labelb" text="old text B" creationComplete="startb()" />
labelb.text = "new text B";
Thank you very much Mike.
Otherwise simply set creationPolicy="all" and it will create all children including those that have not yet been viewed.