views:

230

answers:

1

I have a piece of software I'm working on that is using a viewstack with 3 canvases. With the change event I need to look for index 2 which is the last canvas when it changes to this canvas I need it to grab data from inputs from the previous two canvases.

Within the viewstack events I've assigned the function change() to the event childIndexChange.

Here is the method:

private function change():void
{
 Alert.show(customerViewStack.selectedIndex.toString());
}

eventually this method will look something like this:

public function change():void
{
 if(customerViewStack.selectedIndex == 2)
 {
 rCID.text = cidTxt.text;
 rCNAME.text = nameTxt.text;
 rCACCTN.text = acctNumTxt.text;
 rCACCTR.text = acctRep.text;
 rCWEB.text = website.text;
 rCACTIVE.text = active.text;
 rCSTREET.text = cStreet.text + " "+ cSuite.text;
 rCCSZ.text = cCity.text + ", " + cState.text + " " + cZipcode.text;
 rCPHN.text = cPhone.text;
 rCAPHN.text = cPhone0.text;
 rCFAX.text = cFax.text;
 }

 }

to alternate through my views im using this approach with buttons actually inside the canvases:

customerViewStack.selectedChild=cAddress

anyway the problem is the event doesn't seem to be firing my change function because no alert is coming up also the way I'm doing this is probably quite naive so if you have any suggestions please I'm open.

A: 

I've taken another approach I'm going to bypass "deferred instantiation" and turn the cereationPolicy to all. The view before the last I will set values from there then transition over.

However if anyone has any thoughts or criticism please feel free.

Jreeter
I think you need to listen to 'change' event.. not the 'childIndexChange'
Sai Prasad