The documentation on page 1225 of the dev guide is wrong.
I've passed along a request to have it corrected.
If you look at the DataService API, you'll note that several
methods (fill(), commit(), etc.) return an AsyncToken. This token
is a dynamic class, meaning you can assign ad-hoc data to it, and
the token instance will be returned along with the async result or
fault event for the async call. It is the "T" in the Asynchronous
Completion Token design pattern - used by DataService,
RemoteObject, etc.
When you invoke fill() it returns an AsyncToken to you. You
can add data/context to it like so:
private function doFirstStep():void {
var token:AsyncToken = ds.fill(... your fill args...);
// Add some custom info to the token
token.x = 10;
token.foo = "bar";
token.step = "1st fill";
}
Later, when the result event for this fill is dispatched it
will have this same token attatched to it and you can access the
data you've added to the token to drive your result processing:
private function resultHandler(event:ResultEvent):void {
if (event.token.x == 10) {
// Do something
}
trace(event.token.foo);
if (event.token.step = "1st fill") {
// Do your next step
}
}
Hope that helps,
Seth