[flexcoders] Back-toback WebService calls seem to get lost?

2007-09-28 Thread Fred Barrett
I have some back-to-back web service calls that don't seem to work
when I call them as:

ws.GetMusicians();
ws.GetInstruments();
ws.GetProducts();

but if I call them in a forced-sequential pattern, they all work fine.
(The web server is a .NET service that returns ArrayCollections).

My mxml file calls my GAWebService tier:
var ws = new GAWebService();

The GAWebService tier handles the transaction with the web service:

public function GetInstruments( ):void {
  ws.addEventListener( ResultEvent.RESULT, instrumentsHandler );
  var callToken:AsyncToken = ws.GetInstruments();
  callToken.marker = GetInstrumentsCall;
}

private function instrumentsHandler( event:ResultEvent ):void {
  ws.removeEventListener( ResultEvent.RESULT, instrumentsHandler );
  var callToken:AsynchToken = event.token;
  var resultCollection:ArrayCollection = (event.result AS
ArrayCollection);
  switch( callToken.toString() ) {
 case GetInstrumentsCall:
GADataModel.getInstance().Instruments = resultCollection;
break;
 etc.
  }
}

Again, if I force a sequence wherein the handler of one call makes the
next webservice call in the series, I get all of the results back, but
if I leave it to the asynch-ness of the webservice, I only get a
couple of the calls completed.

Does the Flex WebService queue up the calls or do I have to write some
sort of call queue class in order to manage the asynchronous traffic?



[flexcoders] Nested Viewstacks - Child stack won't display

2007-09-12 Thread Fred Barrett
Long-time .NET programmer, 2-month noob to Flex. I have an
mx:Application / that wants to have an mx:ViewStack / for the main
site navigation, and then inside of a component page I want to have
another mx:ViewStack / for the specific page/form (it has three
pages to it). 

mx:Application
  mx:ButtonBar dataProvider=stack1 /
  mx:ViewStack id=stack1
mx:Canvas label=Home Page/
fmb:MyComponentPage label=Edit Students /
  /mx:ViewStack
/mx:Application

!-- edit students component --
mx:Canvas
  mx:LinkBar dataProvider=formStack /
  mx:ViewStack id=formStack
fmb:MyFormPage1 label=Form Page 1 /
fmb:MyFormPage2 label=Form Page 2 /
fmb:MyFormPage3 label=Form Page 3 /
  /mx:ViewStack
/mx:Canvas

When I either preview the main.xml application in Design Mode, or Run
the application, the main page content shows up, and the mx:LinkBar
/ from the component page displays, but the content of the child
mx:ViewStack id=formStack / doesn't display.

I have attempted to set the .selectedIndex and .visible properties in
script to force the issue, but no avail.

Ideas are appreciated...I guess I can fall back on an mx:State / for
the child form but don't think that's the right answer.